How to Undo in Vim / Vi text editor

Originally published at: https://www.cyberciti.biz/faq/vim-undo/

How do I undo a recent change in the vim text editor?

Press ā€œuā€. Your last edit will be undoed.