If you accidently end up inside vi, you can quit it by pressing Escape, colon (:), q (q), bang (!) and pressing return.