Skip to content

Instantly share code, notes, and snippets.

@im-coder-lg
Forked from dsci/gist:1347672
Last active September 3, 2021 03:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save im-coder-lg/8b3e7994cf874e34179f76563f9046cc to your computer and use it in GitHub Desktop.
Save im-coder-lg/8b3e7994cf874e34179f76563f9046cc to your computer and use it in GitHub Desktop.
Delete commits from repository. Upgraded version
#!/bin/bash
read -p "Git Commit SHA hashcode:" $commit
# First, check out the commit you wish to go back to (get sha-1 from git log)
git reset --hard $commit
# Then do a forced update.
git push origin +$commit^:develop
# Push specific commit
git push origin $commit:develop -f
@im-coder-lg
Copy link
Author

upgraded version

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