Undo reverses the latest available editing action. Redo can reapply an action just undone. This paper editor treats each named replacement as one action. After an undo, a new edit starts a new branch and clears redo. Real apps may group typing differently or limit history; read their available commands.
Worked example
Start with red. Replace it with blue, then replace blue with gold. One Undo returns blue. A second Undo returns red. One Redo then returns blue.
The Pretend Title History
Start with MAP. Action 1 replaces the whole title with MOON. Action 2 replaces the whole title with STAR. Perform one Undo, then another Undo, then one Redo. Finally replace the current whole title with SUN as a new action. Our fictional editor clears the redo branch after that new edit. The example makes no claim about restoring deleted files or recovering a closed app.