How to erase a memory – and restore it