Microsoft Interview Question

How to implement undo and redo in computer