Or, after you hit escape and enter command line mode, you may choose to type q immediately followed by !.
This sequence will quit while also overriding the saving of the file. This can come in handy if you accidentally change a file after you start editing it.