Implement basic undo and redo feature

[#74712160]