0

in my git status I see this

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

modified: file1
modified: file2
modified: file4

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

modified: file1
modified: file4

how can I reset the files to the current staged changes and discarding only the non-staged changes.

user2167582
  • 5,986
  • 13
  • 64
  • 121
  • You want to *keep* the staged stuff, but make the work-tree versions of `file1` and `file4` match the staged stuff, so that `git status` shows three modified files ready to commit and nothing else? – torek May 28 '15 at 17:41

1 Answers1

2

You can do it using checkout command, just like that:

git checkout file1
git checkout file4

Hope this help