fontno
fontno

Reputation: 6872

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

Upvotes: 0

Views: 53

Answers (1)

SLaks
SLaks

Reputation: 888203

You need to do a reset --hard, which will update the working directory.

Upvotes: 2

Related Questions