Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: how to revert a revert

Tags:

git

This is my current situation.

I have erroneously merged a pull request that contained rubbish.

So I reverted it using git revert -m 1 <sha of commit>

Now I wish to undo that revert but this time cherry pick only the correct changes.

Please how do I do that?

Thanks

like image 983
Lisa Anne Avatar asked Oct 16 '25 14:10

Lisa Anne


1 Answers

Revert in git is a commit too. So you can simply revert a revert as usual commit:

git revert <revert_you_want_to_undo_sha1>
like image 76
Vitalliuss Avatar answered Oct 18 '25 04:10

Vitalliuss



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!