git/list[1] front-page[2] threads[3] people[4] search[5] about
 

How-to revert a locally modified file

From
Wink Saville <wink@saville.com>
Date
Dec 1, 2006, 05:23 UTC
Message-ID
<456FBC63.5090609@saville.com>
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,
Next: Junio C Hamano
Message 1 of 3 in “How-to revert a locally modified file”
  1. Wink SavilleDec 1, 2006
  2. Junio C HamanoDec 1, 2006
  3. Wink SavilleDec 1, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.