Save state after undo.