Sometimes I type something, slip and ahead of the command I type a character accidentally like '. The shell responds with> I can type anything I want into that shell and it responds with> How do I get out of that without killing the shell and bringing up a new one?
Type another ' to close the string or hit CTRL-C. The same with double quotes.
HTH. Dirk