简体   繁体   English

git / github从合并拉取请求创建反向补丁

[英]git/github create reverse patch from merged pull request

Situation: We have a couple of github pull requests that have been merged that have code that needs to be rolled back. 情况:我们有几个已合并的github pull请求,这些请求包含需要回滚的代码。 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? 是否有可能根据两个不良拉取请求创建某种反向补丁并将这些补丁应用于新分支,因此我们可以封装不良更改并在修复问题时恢复它们?

A patch can be reversed with git revert . 补丁可以通过git revert逆转。

See also Re-doing a reverted merge in Git . 另请参阅在Git中重新执行还原的合并

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM