git pull is invalid, showing * branch master -> FETCH_HEADAlready up to date. pull invalid solution

Error report

After deleting files in local folder , git pull does not work. Displayed as follows:

*@*** MINGW64 ~/****/haha (master)
$ git pull origin master
From https://gitee.com/****/haha
 * branch            master     -> FETCH_HEAD
Already up to date.

 solve

method one

The command is as follows:

git checkout head <文件名> 

For example, delete a.txt by mistake:

git checkout head a.txt

Restore all files with one command:

git checkout head .

Method Two

The reference articles are as follows:

[Git Tutorial Series Part 22] After deleting the local file, use the git pull command to pull the deleted file from the remote warehouse._git deletes the local file and then pulls nothing_Allen Su's Blog-CSDN Blog

Enter the code as follows:

git fetch --all
git reset --hard origin/master

The above two steps seem to be ok. There is also a third step of code, I tried it and it doesn't seem to work:

git pull

Guess you like

Origin blog.csdn.net/m0_46948660/article/details/131923157