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

Re: "git reset --hard" == "git checkout HEAD" == "git reset --hard HEAD" ???

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 2, 2009, 22:36 UTC
Message-ID
<7v4p0hcp3w.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20090102195724.GA23119@seberino.org>
chris@seberino.org writes:
> Does "git reset --hard" == "git checkout HEAD" == "git reset --hard HEAD" ???

No, but "reset --hard" without a commit-ish defaults to HEAD so the first one and the last one are equivalent.

> It seems we have 2 ways to blow away work we haven't checked in yet then right?
Wrong.
Previous: chris@seberino.orgNext: Sitaram Chamarty
Message 2 of 5 in “"git reset --hard" == "git checkout HEAD" == "git reset --hard HEAD" ???”
  1. chris@seberino.orgJan 2, 2009
  2. Junio C HamanoJan 2, 2009
  3. Sitaram ChamartyJan 3, 2009
  4. Junio C HamanoJan 3, 2009
  5. Sitaram ChamartyJan 3, 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.