Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to Git Pull to update my Git local repo

Tags:

git

pull

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?

like image 881
Léo Léopold Hertz 준영 Avatar asked May 09 '09 08:05

Léo Léopold Hertz 준영


2 Answers

If it hasn't been committed yet:

 git checkout path/to/file
like image 77
August Lilleaas Avatar answered Nov 09 '22 02:11

August Lilleaas


August has the probably best way for your problem.

You could also revert to the last version you pulled:

git reset --hard
like image 35
Lennart Koopmann Avatar answered Nov 09 '22 01:11

Lennart Koopmann