不小心把本地的文件刪除了一個?
想從倉庫git pull 下拉?
對不起,這是不行的,雖然不知道為什么,但是我告訴你怎么回復這個文件。
首先,我們先用git status 看看工作區的變化
$ git status
On branch dev
Your branch is up-to-date with 'origin/dev'.
Changes to be committed:
(use "git reset HEAD
deleted: Application/Home/View/Index/Index.html
Application/Home/View/Index/Index.html 記住這個
工作區告訴我,你把這個文件刪除了,那么接下來是這樣的
一,執行命令:
$ git reset HEAD Application/Home/View/Index/Index.html(注釋:上面的那個路徑)
Unstaged changes after reset:
D Application/Home/View/Index/Index.html
二,執行:
git checkout Application/Home/View/Index/Index.html
好啦,你誤刪的文件回來了
轉載:https://blog.csdn.net/qq_32384249/article/details/73038413
如有侵權,請及時聯系刪除