All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: John Tapsell <johnflux@gmail.com>
Cc: Git List <git@vger.kernel.org>, Stephan Beyer <s-beyer@gmx.net>,
	Christian Couder <chriscool@tuxfamily.org>
Subject: Dangers of reset --hard (Re: Implicit stashes)
Date: Wed, 30 Jun 2010 00:13:26 -0500	[thread overview]
Message-ID: <20100630051326.GA17497@burratino> (raw)
In-Reply-To: <AANLkTilTaQP6qARY1A495vm9HAvLVX_lqIQd1l3WIv7a@mail.gmail.com>

John Tapsell wrote:

> $ git reset --hard
>
> I know this seems very explicit to delete changes, but I myself have
> done this and accidentally lost changes.  For example, I write a unit
> test and don't commit it in on purpose because I know that it
> currently fails and I want to test it against older versions.  I
> carefully git checkout older versions to find if the unit test fails,
> then in stupidity reset back to origin/master ..

Aside: I assume you already know about it, but still I cannot help but
take the opportunity to advertise ‘git reset --keep’.  I was added
fairly recently (1.7.1 rc0) and I find myself annoyed when on machines
without it because of almost exactly this use case.

Stephan and Christian: thanks for writing it.

  parent reply	other threads:[~2010-06-30  5:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-30  2:48 Implicit stashes John Tapsell
2010-06-30  2:56 ` Joshua Jensen
2010-06-30  3:05   ` John Tapsell
2010-06-30  5:57     ` Sverre Rabbelier
2010-06-30 11:27       ` Alex
2010-06-30  5:13 ` Jonathan Nieder [this message]
2010-06-30  8:19   ` Dangers of reset --hard (Re: Implicit stashes) Will Palmer
2010-06-30 16:12     ` Jonathan Nieder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100630051326.GA17497@burratino \
    --to=jrnieder@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=johnflux@gmail.com \
    --cc=s-beyer@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.