4 ms·
> every commit you've made in the past month is saved in the reflog I've heard this before. But since I seem completely unable to remember what a "reflog" is o
by dreamcompiler 7y ago
> every commit you've made in the past month is saved in the reflog
I've heard this before. But since I seem completely unable to remember what a "reflog" is or how to use it, I always just copy my entire repo to another part of my disk before I do anything dicey with git (like rebase). This is of course ridiculous, but for me it's an easier workflow than "oh shit, I screwed up. Now I have to spend 2 hours on Google and SO trying to figure out how to get it all back."
- bschwindHN 7y agoJust in the case you didn't know, you can view the reflog with `git reflog` From there you can grab the commit SHA1s and view their changes with `git show ${SHA1}`, cherry-pick them to your working branch, or whatever else you want to do to recover them.