Created
February 17, 2017 10:05
-
-
Save reqshark/be74e42d291d647ca93a7c63cea27ba0 to your computer and use it in GitHub Desktop.
damn it! committed to the wrong branch again...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FIX TRIGGER HAPPY COMMIT TO WRONG BRANCH: | |
# ---------- | |
git reset --soft HEAD^ | |
git checkout branch | |
git commit | |
# DELETE TAG | |
# ---------- | |
git tag -d 12345 | |
git push origin :refs/tags/12345 | |
# CREATE TAG | |
# ---------- | |
git tag 12345 | |
git push origin 12345 | |
# GIT RESET | |
# ---------- | |
## find the commit that messed it up | |
git reset --hard commitID | |
git push -f origin branchName | |
# GIT IGNORE LOCAL | |
# ---------- | |
git update-index --assume-unchanged $(git ls-files | tr '\n' ' ') | |
# GIT REVERT | |
# ---------- | |
# Resets index to former commit; replace '56e05fced' with your commit code | |
git reset 56e05fced | |
# Moves pointer back to previous HEAD | |
git reset --soft HEAD@{1} | |
git commit -m "Revert to 56e05fced" | |
# Updates working copy to reflect the new commit | |
git reset --hard |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment