How do you recover a commit after git reset –hard?
git reflog shows every move of HEAD with hashes, even for commits no longer in the branch. I find the right entry and go back: git reset --hard <hash>, or create a branch git branch rescue <hash>. The reflog is local and kept for about 90 days by default.