'fatal: cannot lock ref 'HEAD': unable to resolve reference 'refs/heads/master': reference broken

For some reason, when I was in Atom, my master branch suddenly disappeared. And now, I get this error: fatal: cannot lock ref 'HEAD': unable to resolve reference 'refs/heads/master': reference broken



Solution 1:[1]

could you try this

 git remote set-head origin --auto

Better late than never

Solution 2:[2]

Did you try? git reset I think it will work

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Max Roa
Solution 2 Joni Kumar das