If the editor is still open, you can use "Edit -> Undo" or CTRL + Z to undo changes, but it's of course better to have a working version control system if possible.
git works good with local repos and it's not too hard to setup and use (at least on linux).