I forked a project someorg/greatproject on github with branches:
* master
* dev
from my fork I made a branch of dev called my-patch. so me/greatproject has branchs:
* master
* dev
* my-patch
I sent in a pull request, the patch was accepted and merged into dev. great! some time later the upstream dev branch got more changes and I wanted to resync my fork with the up stream. I followed some directions (which I have since lost) everything looked okay so I pushed my synced repo back to github.
I came back today and I found out that i had mistakenly merged someorg's dev branch into my my-patch branch. worse yet git branch
shows just
*my-patch
I found out I can checkout origin/dev and if I follow these directions How do I update a GitHub forked repository? I can also checkout upstream/dev, but in both cases that puts me into something called detached head mode, which I guess is bad or wrong or at least merits some weird warnings.
I want to get back to a state where my fork looks like the original, plus the history of my patch's development on the branch my-patch. Basically, the state I would have gotten had all branches (except my patch) in my fork stayed in lock step with the original repo.
How do I get there?