Completed undo/redo functionality for element removal