From: Junio C Hamano Date: Sun, 03 Mar 2019 01:38:00 GMT Subject: Re: Prevent reset --hard from deleting everything if one doesn't have any commits yet Message-ID: In-Reply-To: <20190301134759.GA13402@sigill.intra.peff.net> Jeff King writes: > Wouldn't that mean all of the file data is available in the object > database? Unfortunately without an index, there's nothing to mark which > file was which. But `git fsck --lost-found` should copy out all of the > file content into .git/lost-found. If we had a hierachically stored index that stores subdirectory contents as a tree (or some tree-like things), "fsck --lost-found" would have been able to recover even pathnames, but with the current flat index in a fresh directory without any commit, we'd get bunch of blobs without any clue as to where each of them goes. It would be far better than nothing, but leaves room for improvement.