While editing, it happens that you apply an unintended change, or make a choice one that you later decide was wrong. All changes to the arrangement of session components (regions, control points) along the timeline can be undone (and redone if necessary).
The default keybindings are Z for Undo and R for Redo. These match the conventions of most other applications that provide undo/redo.
Changes are also saved to the session history file, so that undo/redo is possible even if you close the session and reopen it later, even if you quit Ardour in between.
The maximum number of changes that can be undone can be configured under Edit > Preferences > Misc > Undo. The maximum number of changes stored in the history file is a separate parameter, and can also be set in the same place.
In addition to the normal undo (which works only on actions that change the timeline), there is a visual undo which will revert any command that affects the display of the editor window. Its shortcut is Z. There is also an undo for selection. See Selection Techniques for more information.