Old question but considering it was already bumped a bit ago, I thought I'd add that sometimes if you use the back arrows to return to the previous page if you've accidentally clicked on a link or if you use your history to restore the tab if you've accidentally closed it, what you've typed will be there more often than not, at least in my experience. I don't think this is guaranteed, but there have been multiple times where it's saved my butt. I use chrome, for reference.