If you have typed an <ESC> by mistake, you can get rid of it with a C-g.

quoting the emacs tutorial. made me giggle