Re: Undo git-rm without commit?

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Joe Fiorini <joe@...>
Cc: <git@...>
Date: Wednesday, March 26, 2008 - 2:26 am

On Wed, Mar 26, 2008 at 02:17:18AM -0400, Joe Fiorini wrote:


If by "added" you mean "git add"ed, then yes. The file is hashed and the
blob is put in the object database during the add. Unfortunately,
nothing actually _refers_ to it, so you will have to pick it out
manually by its hash. Try:

  git fsck --lost-found

and then poke around .git/lost-found/other for your missing content.

As an aside, didn't git-rm warn you? While confirming that the command I
was giving you was correct, I did this:

  git init
  echo content >file
  git add file
  git rm file

and got:

  error: 'file' has changes staged in the index
  (use --cached to keep the file, or -f to force removal)

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Undo git-rm without commit?, Joe Fiorini, (Wed Mar 26, 2:17 am)
Re: Undo git-rm without commit?, Jeff King, (Wed Mar 26, 2:26 am)
Re: Undo git-rm without commit?, Joe Fiorini, (Wed Mar 26, 2:38 am)
Re: Undo git-rm without commit?, Matthieu Moy, (Wed Mar 26, 5:48 am)
Re: Undo git-rm without commit?, Jeff King, (Wed Mar 26, 2:39 am)
Re: Undo git-rm without commit?, Mike Hommey, (Wed Mar 26, 2:24 am)