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

difference between "git reset --hard" and "git checkout -f"

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
Apr 30, 2008, 11:37 UTC
Message-ID
<2e24e5b90804300437t39ac16a6ga3cbe0b91d7e5565@mail.gmail.com>
I have two questions:

(1) as in the subject line, what's the difference between these two commands? (I'm talking about those exact commands, not variations). I am unable to see any.

(2) shouldn't one of these have an option to throw away untracked files also, to get to a pristine HEAD-eqvt state? Or is it better to force user to use git clean separately for that?

Thanks,
Sitaram
Next: Miklos Vajna
Message 1 of 3 in “difference between "git reset --hard" and "git checkout -f"”
  1. Sitaram ChamartyApr 30, 2008
  2. Miklos VajnaApr 30, 2008
  3. Johannes SixtApr 30, 2008

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.