{"thread":{"id":"43578","subject":"Re: How-to revert a locally modified file","startedAt":"2006-12-01T05:23:47Z","lastAt":"2006-12-01T06:20:52Z","messageCount":3,"participants":["Wink Saville","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"296528","messageId":"456FBC63.5090609@saville.com","threadId":"43578","inReplyTo":null,"subject":"How-to revert a locally modified file","fromName":"Wink Saville","fromEmail":"wink@saville.com","sentAt":"2006-12-01T05:23:47Z","receivedAt":"2006-12-01T05:23:47Z","isPatch":false,"sender":{"key":"wink@saville.com","avatar":"https://avatars.githubusercontent.com/u/1024284?v=4"},"body":"Hello,\n\nI searched the net and couldn't find the answer to how to revert a\nfile to its \"pre-modified\" state.\n\nI did see in the 0.99.7 To Do:\n\n* Perhaps a tool to revert a single file to pre-modification\nstate? git-cat-file blob `git-ls-files | grep foo` >foo or\ngit-cat-file blob `git-ls-tree HEAD foo` >foo? What should\nthe command be called? git-revert is taken so is\ngit-checkout.\n\nDid such a command come to be?\n\nThanks,\n\n"},{"id":"297674","messageId":"7v4psgduzg.fsf@assigned-by-dhcp.cox.net","threadId":"43578","inReplyTo":"456FBC63.5090609@saville.com","subject":"Re: How-to revert a locally modified file","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-01T05:51:31Z","receivedAt":"2006-12-01T05:51:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Wink Saville <wink@saville.com> writes:\n\n> Hello,\n>\n> I searched the net and couldn't find the answer to how to revert a\n> file to its \"pre-modified\" state.\n>\n> I did see in the 0.99.7 To Do:\n\nWhere did you find 0.99.7 ToDo?  I am curious...\n\n> * Perhaps a tool to revert a single file to pre-modification\n> state? git-cat-file blob `git-ls-files | grep foo` >foo or\n> git-cat-file blob `git-ls-tree HEAD foo` >foo? What should\n> the command be called? git-revert is taken so is\n> git-checkout.\n>\n> Did such a command come to be?\n\ncommit 4aaa702794447d9b281dd22fe532fd61e02434e1\nAuthor: Junio C Hamano <junkio@cox.net>\nDate:   Tue Oct 18 01:29:27 2005 -0700\n\n    git-checkout: revert specific paths to either index or a given tree-ish.\n    \n    When extra paths arguments are given, git-checkout reverts only those\n    paths to either the version recorded in the index or the version\n    recorded in the given tree-ish.\n    \n    This has been on the TODO list for quite a while.\n    \n    Signed-off-by: Junio C Hamano <junkio@cox.net>\n\nSee the EXAMPLES section of git-checkout manual page.\n"},{"id":"295639","messageId":"456FC9C4.5040405@saville.com","threadId":"43578","inReplyTo":"7v4psgduzg.fsf@assigned-by-dhcp.cox.net","subject":"Re: How-to revert a locally modified file","fromName":"Wink Saville","fromEmail":"wink@saville.com","sentAt":"2006-12-01T06:20:52Z","receivedAt":"2006-12-01T06:20:52Z","isPatch":false,"sender":{"key":"wink@saville.com","avatar":"https://avatars.githubusercontent.com/u/1024284?v=4"},"body":"Junio C Hamano wrote:\n> Wink Saville <wink@saville.com> writes:\n> \n> \n> Where did you find 0.99.7 ToDo?  I am curious...\n\nhere: http://kerneltrap.org/node/5678\n\n> \n>     git-checkout: revert specific paths to either index or a given tree-ish.\n>     \n>     When extra paths arguments are given, git-checkout reverts only those\n>     paths to either the version recorded in the index or the version\n>     recorded in the given tree-ish.\n>     \n\nFYI the above seems more obvious then what's in the man page:\n\n\"It updates the named paths in the working tree from the\nindex file (i.e. it runs git-checkout-index -f -u).\"\n\nBut for me saying something like;\n\n\"It reverts the paths in the working tree to the most recent version stored in git.\"\n\nwould even be better. It may not be as precise as the current sentence,\nbut more obvious to this neophyte. Finally, in the EXAMPLES you\nmight add another example of reverting a \"modified the file\" as\nwell as recovering a deleted file.\n\nIn any case thanks,\n\n"}]}