Re: how to recover a repository
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Dec 17, 2010, 04:45 UTC
- Message-ID
- <20101217044530.GA8590@burratino>
- In-Reply-To
- <alpine.DEB.2.00.1012162024020.22269@asgard.lang.hm>
Hi David,
david@lang.hm wrote:
> I managed to do a 'rm *' in the .git directory (the usual sort of > fat-fingering when cleaning up after another mistake) > > the subdirectories are still there.
I'd suggest:
1. Make a backup!
2. From the worktree (i.e. parent to the .git directory),
run "git init".
3. git update-ref HEAD refs/heads/(branch you were on)
4. git reset; # (alas, the old index file is gone)
5. git diff; gitk --allSee gitrepository-layout(7) for details.