Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save deepwilson/4c57ad013ffa17208c2b02eb6acb51c8 to your computer and use it in GitHub Desktop.
Save deepwilson/4c57ad013ffa17208c2b02eb6acb51c8 to your computer and use it in GitHub Desktop.
Using the git reflog command to identify the last-known-good state of your repo
Then, git reset --hard <commit> to revert back to it
Then, another git push --force to reset the remote repository back to that state
"https://community.atlassian.com/t5/Sourcetree-questions/GitHub-repo-lost-much-history-after-forced-push-how-to-restore/qaq-p/254183"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment