Exit Vim without committing changes in Git

:cq!

This will force an error to Vim and it will not save any changes. Link to Vim manual.

You may want to use cq without ! if you want vim to exit with an error and without saving.

Leave a Comment