所以我在一个单独的haml分支中重构我的haml视图。 我不小心删除了我的新haml视图而不是旧的erb视图。
$ 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 status显示
$ 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文件并获得干净的工作目录?
我确信它很简单,但宁可问,也不要让它变得更糟。 感谢
答案 0 :(得分:2)
您需要执行reset --hard
,这将更新工作目录。