How can I Quit vi Editor without Saving Changes?
To quit the vi editor without saving any changes you’ve made, perform the following command:
Type colon (:)
Type q! after colon and press enter
Any changes made are lost and quit from vi editor.
If you are currently in insert or append mode, press Esc.