I use emacs org mode + EVIL on MacOS.
I had a small part of my file visually selected last night when I wrote
:wq and hit
y to the prompt. To my shock and horror this morning only the visually selected part of that file remains.
I could find a backup from two months ago in emacs.d/.saves. I have no idea how emacs decides when to make these backups. So I haven't lost everything. I technically have everything in a git repo, but I wasn't making regular commits so unfortunately that doesn't help me in this case. I guess I should setup a cron task to make regular commits for me.
Are there any other tricks for recovering files in a unixy environment?
Here is the crontask I added after experiencing this, if anyone else has been foolish like me.
0 * * * * cd ~/org-files && git add --all && git commit -m "Automatic Hourly Commit"