In emacs, type Ctrl+x Ctrl+c (or, Alt+x
or, just Alt+x
(this won't ask you to save unsaved files. And will also quit the emacs daemon)
If the keys you press seem to do weird things, then, press Ctrl+g. This will cancel the sequence of keys you may have pressed by mistake.