Git head reference is broken of a branch

How to fix Reference Head is broken of certain branch.

1.Try to stash save first
2. Try to switch to other branch like Master
3. Delete file from ".git\refs\heads\{branch name}" 
4. Delete file from ".git\refs\remotes\origin\{branch name}"
5. if still not works try to delete file from ".git\refs\remotes\origin\HEAD"
6. After that Git fetch --all
7. Switch to desire branch

 

 

 

Leave a Reply

Your email address will not be published.