Answer the question
In order to leave comments, you need to log in
How to restore a branch from a merge?
Please tell me if it is possible to restore a branch that was not pushed to remote, but was merged with another remote branch.
For example, there are 2 branches dev and feature-3. The feature-3 branch was created locally and was not pushed to remote. Next, I merged the dev branch into feature-3 and pushed the dev branch to remote.
Is it possible now, from another device, to somehow remotely restore the feature-3 branch?
Answer the question
In order to leave comments, you need to log in
there are 2 branches dev and feature-3. I merged the dev branch with feature-3 and pushed the dev branch to remote.
Is it possible to branch feature-3?
$ git checkout dev
$ git merge --no-ff feature-3
$ git push remote HEAD
git merge feature-3
at the second step, and the merge was not a fast forward, then the second half can be done like this:$ git checkout dev
$ git pull remote dev
$ git checkout HEAD^2 -b feature-3
<id-мёржа>^<N>
this is the head of branch #N that participated in this merge. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question