git - restoring file that has been deleted or removed or changed



To get the actual name of tracked files, you can do the following

git ls-files (so we know exact path of our files that are being tracked)



Next, we will reset file using the following command (always goes to the commit where your file exist - for example if you remove this file at commit "abc123", trying to reset will do you no good. Go to previous commit and run git checkout -- filetorevert 


for example,

git checkout  ae9beb35694395da48ae7decaae238781e0b2e0e -- /IocRegistrator.cs



Note about the path -> please make sure you know where you are ....cuz it is dependent on your current location when restoring.  :)


Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm