From: Junio C Hamano Date: Fri, 01 Dec 2006 05:51:31 GMT Subject: Re: How-to revert a locally modified file Message-ID: <7v4psgduzg.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <456FBC63.5090609@saville.com> Wink Saville 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 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 See the EXAMPLES section of git-checkout manual page.