I have cloned git project into local git repository. Then I have done something nasty to one of the files and in that panic I deleted file physically from drive (rm style.
If you want to restore all the missing files from the local repository
git checkout .
Warning: This method also restores all changed files and drops all the changes
Use git checkout
. In your case:
git checkout origin/master style.css
This command will update the requested file from the given branch (here the remote branch origin/master
).
Hope this helps
Go to the location of style.css (may be app/css/ )using console otherwise there will be pathspec error.
then execute :
git checkout origin/master style.css
I intentionally deleted some files from a clone --depth 1
and this brought the main files, and submodule ones, back.
git checkout . -f && git submodule update --checkout -f