Karliene
Karliene

Reputation: 157

How to rollback github repository to a previous commit?

How do I revert my Github Repository on Github to it's previous state?
I had made some change and committed them to github, but now I want to undo those changes on github. How would I do that?

I tried doing git reset --hard 7727c5bfa99 but that ONLY changed the repository on my computer and not on the github website

Upvotes: 4

Views: 17572

Answers (2)

Kazunori Takaishi
Kazunori Takaishi

Reputation: 2388

After git reset --hard 7727c5bfa99, you just push the rolled back commit to remote repository(in this case Github repository), using git push <reponame> -f.

Upvotes: 0

bongya
bongya

Reputation: 160

you have to push it. git push -f origin master

Upvotes: 6

Related Questions