Undo: How to undo your past and plan your future