From: Ivan Ionut 
  Sent: Sunday, September 16, 2012 7:06 PM
  Subject: [git-users] Changed but not updated and Changes not staged for commit

  Well after i modified a file... after git status:

  # 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:   file2

  I need to understand why it didn't show:

# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   modified:   file2
#The reason that the "git checkout -- <file>" is provided is because it is a 
method for fetching that specific file from your index and in doing so 
discarding any recent changes. 

That is, you can go forward with "git add <file>",
or you can go back with "git checkout -- <file>".

There is no 'git reset' for just a single file. Reset applies to a whole commit.

The "git checkout -- <file>" can get the file from any commit if one is given 
in the command (see the man page). Getting it fromm the index is the default.

The "--" is the separator that ensures that everying after it is a pathspec 
(see 'git rev-parse --help' and the 'git cli --help').


You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to