Command pattern: 'undo' functionality