Re: Restore a single file in the index back to HEAD
- From
Junio C Hamano <junkio@cox.net>
- Date
- Nov 1, 2006, 08:07 UTC
- Message-ID
- <7vpsc78ua3.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <fcaeb9bf0610312358g1176e4d8q8962b08c2e8ff2c6@mail.gmail.com>
"Nguyen Thai Ngoc Duy" <pclouds@gmail.com> writes:
Show 15 quoted lines
> On 10/27/06, Junio C Hamano <junkio@cox.net> wrote: >> On the other hand, I designed --index-info to be compatible with >> ls-tree output (it is not an accident, it was designed). In >> >> git ls-tree HEAD frotz | git update-index --index-info >> >> "frotz" part does not have to be the exact path but can be a >> directory name. It means "revert everything in this directory". >> >> This is quite heavy-handed and you would probably want to run >> update-index --refresh afterwards. > > I would prefer "git update-index --reset frotz" or "git checkout > --index HEAD frotz". git ls-tree|git update-index is too cryptic for > me and too long for my fingers.
Then perhaps you can use "git checkout HEAD frotz", which is the simplest?