From: Bertram Scharpf Date: Sun, 20 Dec 2009 00:43:40 GMT Subject: Re: Delete a commit Message-ID: <20091220004340.GA30440@marge.bs.l> In-Reply-To: Hi, Am Sonntag, 20. Dez 2009, 01:06:46 +0100 schrieb Johan 't Hart: > Bertram Scharpf schreef: >> 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 ... % git fsck --lost-found dangling commit 6abc221327e896c850c56dafae92277bcfe68e2b It is still there. This is the one I want to delete. Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de