KaviK
KaviK

Reputation: 625

How to undo pushed revert in git?

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?

Upvotes: 1

Views: 1798

Answers (1)

johnsyweb
johnsyweb

Reputation: 141770

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

git checkout branch_name
git revert revert_id
git push origin branch_name

Upvotes: 3

Related Questions