2013-09-23 76 views
1

我已經恢復了一些代碼並將其推送到遠程git存儲庫中。即使將這些更改推送到遠程存儲庫中,我如何「恢復」這些更改。如何撤消在git中推回復?

請在下面找到我做了什麼:

git revert commit_id  
git push origin branch_name 

現在我可以撤銷還原?

+0

谷歌,這裏有足夠的話題... http://stackoverflow.com/questions/6441902/undo-a-git-commit-after-push-using-reverse-patch http:// stackoverflow.com/questions/1270514/undoing-a-git-push – RedX

+0

關於撤消git恢復http://stackoverflow.com/questions/3662543/is-there-any-way-to-undo-the-effects-of -git-revert-head和相當具體的http://stackoverflow.com/questions/8728093/how-to-i-un-revert-a-reverted-git-commit – RedX

回答

3

您所做的更改爲push ed。不要改變別人的歷史!

git checkout branch_name 
git revert revert_id 
git push origin branch_name