Unable to Git Pull to update my Git local repo

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?

Upvotes: 7

Views: 7000

Answers (2)

Lennart Koopmann
Lennart Koopmann

Reputation: 21079

August has the probably best way for your problem.

You could also revert to the last version you pulled:

git reset --hard

Upvotes: 7

August Lilleaas
August Lilleaas

Reputation: 54603

If it hasn't been committed yet:

 git checkout path/to/file

Upvotes: 8

Related Questions