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?
Asked
Active
Viewed 3,585 times
1 Answers
3
A patch can be reversed with git revert
.
See also Re-doing a reverted merge in Git .
-
I figured out that I can do that - my understanding of github was a little too rudimentary. Thanks! – cbmanica Nov 08 '12 at 19:33
-
Our case: the file structure has changed, so we can't use `git revert`. We used `git show
| git apply --reverse --directory= – lefnire Mar 14 '15 at 01:37`