This is really not a duplicate question. I tried few solutions like reset head^
, git checkout -- <file>
,... but this does not solve my problem. The problem is that I can not revert the index.php file from "Changes not staged for commit" from git status because it throws me an error:
Unable to create file www/index.php: Permission denied during executing git "C:\Program Files\Git\bin\git.exe" -c core.quotepath=false checkout HEAD -- www/index.php
I dont understand what is wrong with that. I am an admnistrator, console runs as administrator.. I have all permissions to do this so what permission I need? What the hell is wrong? Help me please I am in the end.
The problem with Git error - permission denied in this case has been caused by the incriminated file was open in other process. The solution was to shut down all the apps except one console, then run git checkout -- www/index.php
and everything works as excepted without any trouble.