Unable to Git Pull to update my Git local repo

倖福魔咒の 提交于 2019-12-09 16:41:40

问题


I removed a file in my local Git repo. I want the file back by updating my Git repo.

I run the following unsuccessfully

git pull

It says upToDate, but I did not get the newest file. The public repo at github does not use SVN, so the problem cannot be SVN.

How can you update your local Git repo, such that you get your removed File back to your computer?


回答1:


August has the probably best way for your problem.

You could also revert to the last version you pulled:

git reset --hard



回答2:


If it hasn't been committed yet:

 git checkout path/to/file


来源:https://stackoverflow.com/questions/842915/unable-to-git-pull-to-update-my-git-local-repo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!