Kirbytech
Kirbytech

Reputation: 634

Rollback to previous commit and make master head on github

I messed up something badly and need to go back to a previous commit. I have looked around and tried lots of things with no success. How do I go back to commit 8add545108ce1a0d6ffebe891c112bb89ccbbae5 and make it my master on github? I can make it master locally but can't seem to get it to sync up with github.

The possible duplicate is not helpful in any way shape or form. I have already seen that and had no luck with it. I did not keep track of which 50 things I tried but I know that was one of them.

Upvotes: 0

Views: 44

Answers (1)

Kirbytech
Kirbytech

Reputation: 634

This solved it for me, I had to play around till I got it to work though.

git revert --no-commit [commit]..HEAD

git commit -m "Revert back to [commit]"

Upvotes: 2

Related Questions