使用反向补丁推后撤消Git提交?


100

我已经推送了一个提交,并且我想通过应用并提交一个反向补丁来还原此提交所引起的更改。我该怎么做?

Answers:




4

只需使用

对于提交的文件:

git revert <SHA1 ID>

对于未提交的文件:

git reset --hard HEAD
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.