Microsoft interview question

How to implement undo and redo in computer