How do I re-attach my head in pycharm?

Viewed 3739

Update: this seems to certainly be what I need. However when I follow the intstructions I am stuck as to how I can get my develop branch to point to my temp branch

i.e. How do I execute the following commands in pycharm:

git branch -f develop temp
git checkout master

I was on the "Trying to crop all frames..." commit (commit f4b641d) and I needed to go back to the previous commit temporarily just to look around. I did so with Checkout Revision and then afterwards I went back to commit f4b641 with another checkout revision though I forced it since I didn't care about lost local changes while.

Either way, I now see in the bottom right of the pycharm GUI (see first image) that I am no longer in the develop branch. So I have been developing on the f4b641 branch and now wish to commit and push my changes in this branch back to the develop branch on github. How do I reattatch my head in pycharm without losing my changes?

The warning dialog informs me I should checkout a branch to avoid losing my work, but if I do that I'll lose my local changes wont I?

enter image description here

enter image description here

2 Answers

The problem with detached HEAD in Pycharm can occur due to misconfigured directory mappings. To solve it, go to Preferences -> Version Control. Check that the path to the project directory is correct and remove all other mappings marked in red, if any.

Related