Undo functionality - backend