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

Re: git undo # last command

From
Fredrik Gustafsson <iveqy@iveqy.com>
Date
Aug 16, 2013, 20:29 UTC
Message-ID
<20130816202904.GA21779@paksenarrion.iveqy.com>
In-Reply-To
<CAAUyY9DqCrpMJPKKmzLGWVkoJRPfA5URLQz0uyTLZCPe6QKe5w@mail.gmail.com>
On Fri, Aug 16, 2013 at 04:21:59PM +0200, Saša Tomić wrote:
> git commit ==> git reset --soft HEAD^

The commit does still exists, you can find it in the reflog. This is important if you for example commits a huge file and wants to remove it. That commit needs to be gc:ed too, and this is dangerous...

It's a not common, but often asked, question on #git@freenode . And for many it's hard to understand why a git rm doesn't shrink their repo.

Also consider that many git commands relies on eachother. For example the submodule scripts uses git checkout, clone, etc.

-- 
Med vänliga hälsningar
Fredrik Gustafsson

tel: 0733-608274
e-post: iveqy@iveqy.com
Previous: Saša Tomić
Message 4 of 4 in “git undo # last command”
  1. Saša TomićAug 16, 2013
  2. Jeff KingAug 16, 2013
  3. Saša TomićAug 16, 2013
  4. Fredrik GustafssonAug 16, 2013

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.