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

Re: reverting a file or files back to repository copy

From
Markus Heidelberg <markus.heidelberg@web.de>
Date
May 2, 2009, 15:33 UTC
Message-ID
<200905021733.08557.markus.heidelberg@web.de>
In-Reply-To
<eaa105840905020825v561f610dj99b1b00581bf1b3d@mail.gmail.com>
Peter Harris, 02.05.2009:
Show 5 quoted lines
> On Sat, May 2, 2009 at 10:54 AM, Aaron Gray wrote:
> > How do I do the eqivalent of an 'svn revert' on a single file, on a
> > directory of files, or on all files ?
> 
> git checkout <files>

This will use the state of the files from the index. To revert to the latest commit, i.e. discard all your local changes of particular files, use

    git checkout HEAD -- <files>
Markus
Previous: Peter Harris
Message 3 of 3 in “reverting a file or files back to repository copy”
  1. Aaron GrayMay 2, 2009
  2. Peter HarrisMay 2, 2009
  3. Markus HeidelbergMay 2, 2009

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.