简体   繁体   中英

Git deleted files sticking around. How do i get a clean working directory?

So I'm refactoring my views in haml in a separate haml branch. I accidentally removed my new haml views instead of old erb views.

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

So I did a reset

$ 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 shows

$ 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
.
.
.

Where do I go from here in order to keep the haml files only and get a clean working directory?

Im sure its simple but would rather ask than make it worse. Thanks

你需要reset --hard ,这将更新工作目录。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM