GNU Emacs Manual
L. Commands for Fixing Typos
In this chapter we describe the commands that are especially useful for
the times when you catch a mistake in your text just after you have made
it, or change your mind while composing text on the fly.
The most fundamental command for correcting erroneous editing is the
undo command, C-x u or C-_. This command undoes a single
command (usually), a part of a command (in the case of
query-replace), or several consecutive self-inserting characters.
Consecutive repetitions of C-_ or C-x u undo earlier and
earlier changes, back to the limit of the undo information available.
See section D.4 Undoing Changes, for more information.