Unfortunately, this site does not have an autosave feature or save feature of any sort. If it's been deleted before it's posted, it's gone-gone for good without having any other type of external software. This has been something we've all experienced at some point.
When I'm writing long answers, I usually copy it multiple times, or even write it in a document, like Microsoft, Google Docs, or Notepad. You can always post an answer early and edit it, too -- Just make sure it answers the question first before doing that.
Important mention:
There are probably some browser extensions you can use that will remember form data (such as the contents of the answer box) when you click off the page.
commented by Fizz