Skip to content

Instantly share code, notes, and snippets.

@samredai
Last active January 24, 2020 18:30
Show Gist options
  • Save samredai/2c22724175d06af94f7274f4abd740ab to your computer and use it in GitHub Desktop.
Save samredai/2c22724175d06af94f7274f4abd740ab to your computer and use it in GitHub Desktop.
Git: Remove the latest commit in GitHub
git push -f origin HEAD^:master
# Note that you if you just want to remove a commit locally and...
# ...keep the change as uncommited modifications to the local files, use the line below:
git reset --soft HEAD~1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment