Skip to content

Instantly share code, notes, and snippets.

@carlosh93
Forked from dsci/gist:1347672
Last active August 19, 2020 16:37
Show Gist options
  • Save carlosh93/c4d1a9c586179957404f73a61b64faa0 to your computer and use it in GitHub Desktop.
Save carlosh93/c4d1a9c586179957404f73a61b64faa0 to your computer and use it in GitHub Desktop.
Delete commits from git repository #git #bash #linux #github
# First, check out the commit you wish to go back to (get sha-1 from git log)
git reset --hard 9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a
# Then do a forced update.
git push origin +9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a^:develop
# Push specific commit
git push origin 9d3c3a0caa7f7b35ef15adb96fc80fcbb59ac72a:develop -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment