简体   繁体   English

如何在github上删除以前与master合并的分支

[英]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.

相关问题 如何获取以前合并到主分支的整个更改列表? - How to get whole list of changes for a previously-merged-to-master branch? 如何将合并分支从主分支(Github)中取出? - How take a merged branch out of a master branch (Github)? 如何恢复以前合并的分支 - How to recover a previously merged branch 从主分支中删除单个合并分支 - Remove a single merged branch from master branch 如何停止与开发分支合并的分支与主分支合并? - How to stop a branch merged with develop branch to be merged with master branch? GitHub/GitLab REST API - 如何知道一个分支(dev)是否合并到另一个分支(master)中? - GitHub/GitLab REST API - How to know a branch (dev) is merged into another branch (master) or not? 我在git的错误分支上创建了一个分支,并将旧分支合并到master中,如何从另一个分支中删除提交? - I created a branch off of the wrong branch in git and already merged the old branch into master, how do I remove the commits from the other branch? 在GitHub中合并+压缩PR到master后,如何同步你的git dev分支? - How to sync up your git dev branch after you've merged+squashed a PR to master, in GitHub? Github:当特定分支合并到主分支时,如何通知松弛? - Github: How can I notify to slack when specific branch is merged into master? 如何使用 Github API 从合并到 master 的分支中获取 PR 信息? - How do I get the PR information from a branch that's been merged to master using the Github API?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM