[英]How to remove previously merged branch with master on github
So I created a branch and made some changes there and then made a push on my github account and accidentally merge it with master.因此,我创建了一个分支并在那里进行了一些更改,然后在我的 github 帐户上进行了推送,并且不小心将其与 master 合并。
Is there a way to undo this?有没有办法撤销这个?
Roll back to the premerge state.回滚到预合并状态。
git revert HEAD
You can also specify the exact commit/hash/sha.您还可以指定确切的 commit/hash/sha。
git revert -m 1 f4f78b319c308600eab015a5d6529add21660dc1
您可以使用 Git UI 恢复您的合并。请参考以下链接: https : //help.github.com/en/github/collaborating-with-issues-and-pull-requests/reverting-a-pull-请求,或者您可以使用命令 --> git reset --hard [commit_before_merge] 在那里您需要将头部重置为当前头部之前的提交。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.