1

I have reverted some code and pushed into a remote git repository. How can I "un revert" the changes even though it was pushed into a remote repository.

Please find below what I have done:

git revert commit_id    
git push origin branch_name

Now can I undo the revert?

johnsyweb
  • 136,902
  • 23
  • 188
  • 247
KaviK
  • 625
  • 9
  • 18
  • Google, there are enough topics on that... http://stackoverflow.com/questions/6441902/undo-a-git-commit-after-push-using-reverse-patch http://stackoverflow.com/questions/1270514/undoing-a-git-push – RedX Sep 23 '13 at 10:56
  • On undoing a git revert http://stackoverflow.com/questions/3662543/is-there-any-way-to-undo-the-effects-of-git-revert-head and quite specific http://stackoverflow.com/questions/8728093/how-to-i-un-revert-a-reverted-git-commit – RedX Sep 23 '13 at 10:58

1 Answers1

3

Your change has been pushed. Do not change others' history!

git checkout branch_name
git revert revert_id
git push origin branch_name
johnsyweb
  • 136,902
  • 23
  • 188
  • 247