Search code examples
githubgit-pullgit-remote

Can I download contents remotely by "git pull staff master" for as many times as I want?


I downloaded a bunch of files into a local folder by "git pull staff master" a few days ago. But I deleted the entire folder by mistake. Then I tried to download those files again by "git pull staff master" again. Although I got

From ...(URL)
* branch      master    -> FETCH_HEAD
Already up to date

I didn't have files in fact downloaded in the folder. During those days, I didn't make any changes. The URL of the remote repo remained the same.

How can I download those files again? Is there a setting like "can only git pull once" that prevents me from downloading those files for more than once?


Solution

  • No, there is no such thing as git pull only once.

    If you accidentally deleted all your file, see if it is still in the git by doing git status, and the deleted file should be indicated as deleted.

    If you want to restore the file, use git checkout FILENAME. If you deleted the entire content of the folder, you can do git checkout . (notice the dot .) to restore all the files.