I lost my commits in Git and then I discovered about git reflog

Posted by sshetty03@reddit | programming | View on Reddit | 47 comments

I checked out an old commit to test something and ended up in a detached HEAD.
Made changes, committed, switched back, and suddenly my commits were gone.

That’s when I discovered git reflog.
It quietly tracks every move, even the ones you think you’ve lost.

wrote about the full recovery process in a short here -> https://medium.com/stackademic/what-is-detached-state-in-git-and-how-do-you-recover-from-it-eff10834e41f?sk=5f15731679de4a76209af7f419b57678