Skip to content

Tag: reflog

Finding Lost Commit History using the GitHub API

It is quite easy to lose commit history in Git. A mistaken forced push is enough to rewrite the past and lose valuable work. Assuming the user in question has not done a git fetch in a while reflog won’t help you either. This happened to me while dealing with a branch that had a misconfigured remote pointing to the mainline. In my stupor, I forced the push. Outdated reflog! Perhaps GitHub has the Answer? All is not lost however you can access all the information you need via the GitHub API. Assuming you have stopped the team making anymore commits to the…