Just a tip if this happened because you weren’t logged in when you pressed “Reply”. Sometimes when you go to the previous page in the browser after the error message is displayed, and put your cursor in the text box, your previous text will have been cached and will still be there.
You are right, though, that safest is to copy your text before you hit send, because you never know what glitch will happen with software.