Re: Git reset --hard with staged changes
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 9, 2014, 23:28 UTC
- Message-ID
- <xmqq61k9d5nk.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CANWD=rVB249Vu1QMk64V+FxfCfJPzxqZgCfyEuixJJ_iKoTLPQ@mail.gmail.com>
Pierre-François CLEMENT <likeyn@gmail.com> writes:
> Hm, I didn't think of "git apply --index"... Makes sense for this > special use, but I'm not sure about the other use cases.
Try merging another branch that tracks a file your current branch does not know about and ending up with conflicts during that merge. Resetting the half-done result away must remove that new path from your working tree and the index.