在Bitbucket Repo中恢复合并分支 [英] Restore Merged Branch in Bitbucket Repo

查看:499
本文介绍了在Bitbucket Repo中恢复合并分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

帮助!我需要恢复一个分支。我一直在用Bitbucket UI使用 git 来尝试和简化事情,但错过了一个复选框......



< 我做了什么:

我创建了一个拉取请求并合并了我的特性分支到 dev 分支中,关闭特性分支(所需结果)。

然后我创建了一个pull请求,并将我的 dev 分支合并到 staging

code> branch(desired),但是我错过了复选框仍然被标记为合并时关闭分支,这发生了(不需要)。

我想要的:

我想回滚合并我有一个带有特性分支的 dev 分支并入其中(包括它的所有提交历史记录等)。我不在乎是否 staging 分支是 dev -branch-less,或者不是,我不介意创建拉取请求并在必要时再次正确合并它们。 现在是否可以使用其历史记录恢复dev分支?

解决方案


是否可以恢复 dev 分支现在已经关闭了吗?


如果您本地仍有分支 - 只需使用如果需要的话,将本地分支推送到远程并将功能分支合并到它。






如果您没有任何这些分支。



该怎么办?



阅读答案,并学习如何使用reflog恢复您的分支机构。
[
如何将HEAD移回以前的位置? (Detached head)



另一个选项是检出合并的分支,并使用 checkout将其分割为所需的提交 code> command - 在上面的答案中再次提供完整的详细信息。



另一个选项是签出基本分支并使用樱桃挑选来选择提交范围需要。


Help! I need to recover a branch. I've been using git with the Bitbucket UI to try and simplify things, but missed a checked checkbox...

What I did:

I created a pull request and merged my feature branch into the dev branch, closing the feature branch (desired outcome).

I then created a pull request and merged my dev branch into the staging branch (desired), but I missed that the checkbox was still marked to "close branch on merge", which happened (not desired).

What I want:

I would like to roll back the merge so that I have a dev branch with the feature branch merged into it (with all its commit history, etc). I don't care if the staging branch is dev-branch-less, or not, I don't mind creating the pull request and merging them correctly again if necessary. Is it possible to recover the dev branch with its history now that it has been closed?

解决方案

Is it possible to recover the dev branch with its history now that it has been closed?

If you still have the branch locally - simply use it, push the local branches to the remote and merge the feature branch into it if you need to.


In case you don't have any of those branches.

What to do?

Read this answer and learn how to use reflog to recover your branches. [How to move HEAD back to a previous location? (Detached head)

Another option is to checkout the merged branch and to split it into the desired commits using the checkout command - again full details in the above answer.

Another option is to checkout the base branch and use cherry-pick to select the range of commits you need.

这篇关于在Bitbucket Repo中恢复合并分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆