The closest thing the original
vi has to multiple undo (aside from
U which can revert multiple changes within a single line) is the numbered registers,
which hold the nine most recent changes or deletions.
If you put from a numbered register, subsequent dot commands
will increment that register when it repeats the command.
E.g. with the following text, with the cursor line indicated with
dd.. will result in:
If you then type
"1P, vi will put the most recent deletion
. will put the contents of the next most recent
register, by doing
"2P, and hitting
. again will put
the contents of register
So, in short,
"P.. will put back all the text you deleted,
leaving you with
Not brilliant, but better than nothing! More usefully you
can use it at the beginning or end of the buffer to quickly
inspect what's in your numbered registers. Then you can
easily delete what you don't need.
It's documented in