Re:Git as a Storage
by yepguy on Friday October 08, 2021 @03:13PM
(#28802947)
Emacs kind of has this in the form of magit-wip-mode. It doesn't sync with the undo system but it does persist every file save event since the last "real" commit.
[ Parent
| on HN ]
I need to look into this.
Just yesterday I lost some work (only maybe 10 minutes worth) when I was updating my org notes. I staged some files, committed them, but made a typo in the commit message. I ended up reverting the commit when I meant to amend. Then I discarded the the staged reverted changes and noticed the status said I was still reverting. So I looked up the command to get me out of that state. I ran 'git revert --abort' and it blew away my unstaged changes. Ah well, those versioned backups I have Emacs do are going to save me this time, or so I thought.
If you did actually commit, you should be able to find the changes on the reflog
In magit, it's accessable from the log menu
Create a branch, reset it to the badly worded commit hash and then you can try to ammend again.