Skip to content

Instantly share code, notes, and snippets.

@sketchbuch
Last active July 27, 2020 05:17
Show Gist options
  • Save sketchbuch/ba201d8f953f4e586ff17db2d0747c34 to your computer and use it in GitHub Desktop.
Save sketchbuch/ba201d8f953f4e586ff17db2d0747c34 to your computer and use it in GitHub Desktop.
GIT - Delete last commit
Delete Last Commit
==================
# Remove last commit locally
git reset HEAD^
# Push changes to remote which will remove the commit
git push origin +HEAD
Delete Last Commit From Remote Only
===================================
git push origin +HEAD^:<name-of-your-branch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment