DEV Community

Discussion on: How to Undo Pushed Commits with Git

Collapse
 
eberjoe profile image
Eber Rodrigues

As the article mentioned, you can revert multiple commits by reverting an entire branch or a tag. And no, you don’t need to start from the top. You can pick any commit or group of commits in the repo’s history to revert.

Collapse
 
blackgirlbytes profile image
Rizèl Scarlett

Thanks @eberjoe ! That's correct. @vineetgnair I don't go too deep into it, but you can use any git revision with git revert.

You don’t have to use the commit hash to identify the commit you want to revert. You can use any value that is considered a gitrevision, including the:
Tag
Branch
Hash
Reference

And yes, you don't need to start from the top. I just start from the top in my example.