OpenWindows Advanced User's Guide

6.5.4.1 Undoing the Previous Command

If you make a mistake in vi or if you just change your mind once an operation is completed, you can undo your last command by pressing u immediately after the command. (There's no need to press Esc after typing u.) Pressing u a second time undoes the undo.