Skip to content

Instantly share code, notes, and snippets.

@neogeogre
Last active April 15, 2023 15:01
Show Gist options
  • Save neogeogre/ecde6dc6c422ef77a900e4cde3bb99ef to your computer and use it in GitHub Desktop.
Save neogeogre/ecde6dc6c422ef77a900e4cde3bb99ef to your computer and use it in GitHub Desktop.
revert HEAD to a certain commit point using git commands
# https://stackoverflow.com/questions/3380805/checkout-old-commit-and-make-it-a-new-commit
# https://gist.github.com/CrookedNumber/8964442?permalink_comment_id=3426850#gistcomment-3426850
git reset --hard 0fee5ad9
git push origin -f
# https://stackoverflow.com/questions/7744049/git-how-to-rebase-to-a-specific-commit
git rebase --onto <new parent commit hash> <old parent commit hash>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment