Wait till you figure out that an undo/redo system basically means saving and loading the game at absolutely any and each step that you take. Games like Factorio even combine the two, where you can chose to have a replayable savegame, essentially recording your every action, for video-like playback. This is achieved through carefully designing the data model for actions and states.
Latest Answers