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

Re: Delete a commit

From
Johan 't Hart <johanthart@gmail.com>
Date
Dec 20, 2009, 00:06 UTC
Message-ID
<hgjpqu$dos$1@ger.gmane.org>
In-Reply-To
<20091219233957.GC29111@marge.bs.l>
Bertram Scharpf schreef:
Show 6 quoted lines
> Hi,
> 
> I fetched a line from the shell's history and accidentally hit
> enter before editing it. Then I had commited some work that was
> not completed. Is there a way to get rid of that commit as if it
> never were there?

Try: git reset --soft HEAD~1

You could also: git commit --amend ...

when you realy finish the commit.
Show 6 quoted lines
> 
> Thanks in advance.
> 
> Bertram
> 
> 
Previous: James P. Howard, IINext: Bertram Scharpf
Message 3 of 8 in “Delete a commit”
  1. Bertram ScharpfDec 19, 2009
  2. James P. Howard, IIDec 19, 2009
  3. Johan 't HartDec 20, 2009
  4. Bertram ScharpfDec 20, 2009
  5. Pascal ObryDec 20, 2009
  6. Johan 't HartDec 21, 2009
  7. Andreas SchwabDec 21, 2009
  8. Bertram ScharpfDec 21, 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.