Skip to content

Instantly share code, notes, and snippets.

@fanbyprinciple
Last active January 18, 2023 05:15
Show Gist options
  • Save fanbyprinciple/7ab3ef74604c82b382df1ce7219f1453 to your computer and use it in GitHub Desktop.
Save fanbyprinciple/7ab3ef74604c82b382df1ce7219f1453 to your computer and use it in GitHub Desktop.
How to undo a commit on github

Reset it to previous commit -

git reset --hard HEAD^

Force a push -

git push --force

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment