If you do not save your file for several minutes, Emacs automatically saves the file (auto-save feature) in a file name the same as yours with a ‘#’ before and after. In case of disaster, e.g. the electrical power goes out, you can retrieve the latest auto-save copy by copying that file to your file. Inside Emacs type M-x recover-file then type in the name of your file you want to recover. Then you can save with C-x C-s to put the recovered text into the file itself.