When you are finished editing your text you will need to quit vi. When you do so you have the option to save the changes you made or throw them away. The following table shows you the command for saving and quitting:

Command What It Does
:q! Quit without saving changes
:w Save changes to hard disk
:w new_filename Write changes to a new file on disk
:wq Save changes and quit vi (from last line mode)
zz Save changes and quit vi (from command mode)