views:

24

answers:

1

Repo: mergetest

$pwd

/gitvobs/mergetest/apple

$git status

On branch br1

Changed but not updated:

(use "git add ..." to update what will be committed)

(use "git checkout -- ..." to discard changes in working directory)

   **modified:   inside**

$git checkout inside

error: pathspec 'inside' did not match any file(s) known to git.

$git checkout apple/inside works perfect

So every-time, do i need to specify the full path of a file to unstage changes when am within a sub-directory?

This is not the case with add (i can add file using 'git add file-name' anywhere)

Is this the way GIT behaves or is this changed in other versions of GIT?

Am using git version 1.6.6

Thanks

A: 

On git version 1.7.1, I can use git checkout inside to revert the file. Here's the commit which introduced the feature, if you're curious.

Edit: Actually, it works in git version 1.5.6.5 as well. So I'm not sure what this means.

jleedev