* How-to revert a locally modified file
@ 2006-12-01 5:23 Wink Saville
2006-12-01 5:51 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Wink Saville @ 2006-12-01 5:23 UTC (permalink / raw)
To: git
Hello,
I searched the net and couldn't find the answer to how to revert a
file to its "pre-modified" state.
I did see in the 0.99.7 To Do:
* Perhaps a tool to revert a single file to pre-modification
state? git-cat-file blob `git-ls-files | grep foo` >foo or
git-cat-file blob `git-ls-tree HEAD foo` >foo? What should
the command be called? git-revert is taken so is
git-checkout.
Did such a command come to be?
Thanks,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How-to revert a locally modified file
2006-12-01 5:23 How-to revert a locally modified file Wink Saville
@ 2006-12-01 5:51 ` Junio C Hamano
2006-12-01 6:20 ` Wink Saville
0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2006-12-01 5:51 UTC (permalink / raw)
To: Wink Saville; +Cc: git
Wink Saville <wink@saville.com> writes:
> Hello,
>
> I searched the net and couldn't find the answer to how to revert a
> file to its "pre-modified" state.
>
> I did see in the 0.99.7 To Do:
Where did you find 0.99.7 ToDo? I am curious...
> * Perhaps a tool to revert a single file to pre-modification
> state? git-cat-file blob `git-ls-files | grep foo` >foo or
> git-cat-file blob `git-ls-tree HEAD foo` >foo? What should
> the command be called? git-revert is taken so is
> git-checkout.
>
> Did such a command come to be?
commit 4aaa702794447d9b281dd22fe532fd61e02434e1
Author: Junio C Hamano <junkio@cox.net>
Date: Tue Oct 18 01:29:27 2005 -0700
git-checkout: revert specific paths to either index or a given tree-ish.
When extra paths arguments are given, git-checkout reverts only those
paths to either the version recorded in the index or the version
recorded in the given tree-ish.
This has been on the TODO list for quite a while.
Signed-off-by: Junio C Hamano <junkio@cox.net>
See the EXAMPLES section of git-checkout manual page.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: How-to revert a locally modified file
2006-12-01 5:51 ` Junio C Hamano
@ 2006-12-01 6:20 ` Wink Saville
0 siblings, 0 replies; 3+ messages in thread
From: Wink Saville @ 2006-12-01 6:20 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Junio C Hamano wrote:
> Wink Saville <wink@saville.com> writes:
>
>
> Where did you find 0.99.7 ToDo? I am curious...
here: http://kerneltrap.org/node/5678
>
> git-checkout: revert specific paths to either index or a given tree-ish.
>
> When extra paths arguments are given, git-checkout reverts only those
> paths to either the version recorded in the index or the version
> recorded in the given tree-ish.
>
FYI the above seems more obvious then what's in the man page:
"It updates the named paths in the working tree from the
index file (i.e. it runs git-checkout-index -f -u)."
But for me saying something like;
"It reverts the paths in the working tree to the most recent version stored in git."
would even be better. It may not be as precise as the current sentence,
but more obvious to this neophyte. Finally, in the EXAMPLES you
might add another example of reverting a "modified the file" as
well as recovering a deleted file.
In any case thanks,
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-12-01 6:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-01 5:23 How-to revert a locally modified file Wink Saville
2006-12-01 5:51 ` Junio C Hamano
2006-12-01 6:20 ` Wink Saville
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.