Need help recovering lost Commit SHA from May 11th after accidental force push #196319
Replies: 3 comments 1 reply
This comment was marked as low quality.
This comment was marked as low quality.
-
|
Sorry this happened. The safest path is to avoid making more destructive changes until you have copied whatever commit IDs you can find. Here is the order I would try:
On the machine where the work existed, run: git reflog --date=isoLook for entries from around May 11, then create a backup branch before resetting anything: git branch recovery/YOUR_DATE YOUR_SHAThis is safer than immediately running
For a public repo, this can sometimes show recent push events: Search the JSON for
If you used another laptop, Codespaces, a deployment machine, or an IDE with local history, check those too. Any clone that had the old
Also look at:
Once you find the SHA, first make a branch from it: git fetch origin
git branch recovered-main YOUR_SHA
git log --oneline recovered-mainOnly after you confirm the history is correct should you decide whether to restore |
Beta Was this translation helpful? Give feedback.
-
|
Hi @Krystyn-Kevin , This community is managed by GitHub employees, but it is not a support forum. The only place to go for answers to account-specific questions like this one is opening a ticket on our Support page. This is a public forum, and the community is unable to assist with nor escalate your ticket, but we can assure you it is in the right place. It will be answered in the order it was received based on our team's resources and the amount of tickets ahead of yours. As no other Community Discussions team members will be able to provide additional help with account related questions I am going to close this discussion. We appreciate your understanding and patience while Support works through your request! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
🏷️ Discussion Type
Question
Body
Hi Community Managers and GitHub Staff,
I accidentally ran a
git push --forcefrom my terminal today. This unfortunately overwrote my main branch and wiped out 2 months of development history, losing over 60 previous commits.Because I am on the free tier, I cannot submit a technical support ticket. However, my entire project history is lost.
Could a GitHub staff member please check the server-side Remote Reflog or Push Events log for my repository? I explicitly need the Commit SHA (Hash ID) for my last successful commit/push from May 11th, 2026, so I can stitch my history back together.
Repository details:
Thank you so much for your time and help!
Beta Was this translation helpful? Give feedback.
All reactions