0

Here is my git log:

59fb0ca <- 3546ed8 <- 653d53s(HEAD, master)

and I want to go back 59fb0ca commit to check out what I did so I do:

git checkout 59fb0ca
59fb0ca(HEAD) <- 3546ed8 <- 653d53s(master)

Now the HEAD points where I need to go over. After I play with the commit with no modification or adding files, I want to go back to the tip of the branch which is 653d53s. So I do

 git checkout master

But git complains with below message:

git checkout master

error: cannot stat 't2.txt' : permission denied.

I do not know why I do not have the permission on the file.

Community
  • 1
  • 1

1 Answers1

1

When you are switching between the branches, git will restore or remove files based on the commits.

This is windows issue where the t2.txt is locked up by one of the windows application or server.

Try closing down all the application which you think might be culprit (in my case it was Visual studio) and retry

git checkout master or git reset --hard origin/master

which will reset to master HEAD

Siva Kandaraj
  • 814
  • 7
  • 15