Contents
Type u to undo the last change. To undo the two last changes, you would type 2u . Press Ctrl-r to redo changes which were undone.
How do I undo a previous command?
To reverse your last action, press CTRL+Z. You can reverse more than one action. To reverse your last Undo, press CTRL+Y.
How do you undo in Unix?
Unix doesn’t natively provide an undo feature. The philosophy is that if it’s gone, it’s gone. If it was important, it should have been backed up. Instead of removing a file, you can move it to a temporary “trash” directory.