Git cannot lock ref 'HEAD': unable to resolve reference HEAD
I had the same problem, this worked for me:
Step 1.
- go to
.git\logs\refs\heads
and open the Document named asYOUR_BRANCH
, now copy theID
numbers in front of your user name and email
Step 2.
- go to
.git\refs\heads
and open the document named asYOUR_BRANCH
delete the line and paste theID
in.
I had the same problem and the only solution that I found was to navigate to the head like so:
.git/refs/heads/branch_name
And I deleted the head file. Then I went to the console and I used the command:
git reset
Then all the files were unstaged so add them and commit them afterwards.