You won’t lose commits by closing the terminal.
ctrl+c will exit the prompt >
What happened was you opened up a string with the odd number of '
characters.
Bash expects more input for your string, and allows you to enter it after the >
prompt.
Try typing '
and hit return, you will get the same thing. If you close the string by typing ‘`’ again, you will be back to your normal bash prompt.