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

Re: checkout vs reset

From
Jay Soffian <jaysoffian@gmail.com>
Date
Feb 26, 2009, 07:12 UTC
Message-ID
<76718490902252312h6a08f5a6x972523e7c7e4af16@mail.gmail.com>
In-Reply-To
<76718490902252308r474b193yba21b14e14a3baa@mail.gmail.com>
On Thu, Feb 26, 2009 at 2:08 AM, Jay Soffian <jaysoffian@gmail.com> wrote:
Show 8 quoted lines
> Is there any different between the following two commands?
>
> git reset <commit> -- <paths>...
> git checkout <commit> -- <paths>...
>
> As far as I can tell from the man pages, they are equivalent. To wit:
> both update the index and working copy for the given paths to the
> state that they were in in <commit>.

Doh, answering my own question. reset only touches the index, not the working copy. checkout updates both.

j.
Previous: Jay SoffianNext: Sitaram Chamarty
Message 2 of 3 in “checkout vs reset”
  1. Jay SoffianFeb 26, 2009
  2. Jay SoffianFeb 26, 2009
  3. Sitaram ChamartyFeb 26, 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.