2013-05-08 70 views
0

所以我在haml中分別在haml分支中重構我的視圖。 我不小心刪除了我的新haml視圖而不是舊的erb視圖。Git刪除了附近的文件。我如何得到一個乾淨的工作目錄?

$ git rm app/views/projects/edit.html.haml app/views/projects/new.html.haml ..... 

所以我做了復位

$ git reset HEAD app/views/projects/edit.html.haml app/views/projects/new.html.haml ..... 
Unstaged changes after reset: 
D app/views/projects/_form.html.erb 
D app/views/projects/edit.html.erb 
D app/views/projects/edit.html.haml 
. 
. 
. 

git的狀態顯示

$ git status 
# On branch haml 
# Changes not staged for commit: 
# (use "git add/rm <file>..." to update what will be committed) 
# (use "git checkout -- <file>..." to discard changes in working directory) 
# deleted: app/views/projects/_form.html.erb 
# deleted: app/views/projects/edit.html.erb 
# deleted: app/views/projects/edit.html.haml 
. 
. 
. 

我在哪裏何去何從,以只保留HAML文件,並得到一個乾淨的工作目錄?

我確定它很簡單,但寧可問,也不要讓它變得更糟。 謝謝

回答

2

您需要做一個reset --hard,它將更新工作目錄。

+0

完美,謝謝。我很擔心 - 最初在重置時很難做到,但現在很合理。 – fontno 2013-05-08 21:21:16

相關問題