I think this used to exist in previous JIRA version. In the new UI, if you hit the cancel button the comment is removed. And because the Cancel button is very close to the Submit button, often you can miss click and instead of hitting the Submit button you click the Cancel button.
Imagine the frustration (and decrease in productivity) when you have spent 30 minutes to write a huge comment with tech details and formatting etc, and accidentally you hit the Cancel button instead of the Submit button.
I think that the user should be prompted to confirm if they want to cancel their comment, eg. some message like 'are you sure that you want to cancel the comment all text will be erased'.
I believe there will be a few more people that this has happened to them at least once, and is not just me.
Please discuss this internally and apply this change, it's going to save many peoples' time from re writing accidentally deleted comments.