I\'m still relatively new to Git and I have made a bit of a mess of my repository. I\'m hoping there is a way to fix it without re-cloning.
I have a repository whic
I made a similar mistake (creating a local branch named origin/...) a couple of times.
To protect against this sort of mistakes (and assuming you will never want a local branch whose name actually starts with origin/) you can run the following commands in repo/.git/refs/heads:
mklink /d remotes nul
mklink /d origin nul
mklink /d upstream nul
They create symlinks to nul that would prevent creating subdirectories under those names. Now accidental mistakes like git branch origin/feature will give an error:
unable to create directory for .git/refs/heads/origin/feature