2

Situation: We have a couple of github pull requests that have been merged that have code that needs to be rolled back. Interspersed with these merges are others that need to be preserved. I know we can roll back to prior to the first bad merge and cherry pick changes after that, but I'm hoping we can avoid that hassle. Is it possible to create some kind of reverse patch based on the two bad pull requests and apply those patches to a new branch, so we can encapsulate the bad changes and restore them when the problems with them have been fixed?

1 Answer 1

3

A patch can be reversed with git revert.

See also Re-doing a reverted merge in Git .

Sign up to request clarification or add additional context in comments.

2 Comments

I figured out that I can do that - my understanding of github was a little too rudimentary. Thanks!
Our case: the file structure has changed, so we can't use git revert. We used git show <sha> | git apply --reverse --directory=<new root>

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.