The ESC key backs out of the comment you are writing and completely erases it. You cannot undo this action.
Twice today I've been burned by the ESC key on my MacBook. I brushed over it once by accident and didn't realize what happened. Later I intentionally hit it as I had accidentally activated Siri while I was writing a comment.