ran git reset --hard and lost today
had everything staged, hadn't committed, meant to do reset --soft. is it gone
Your discussion
This browser holds the management token for this post.
Save management token
Keep this private. Anyone with the token can resolve or delete this discussion.
4 replies
Staged is good news. git add wrote the blobs into the object store, they just have no name now.
git fsck --lost-found
Then look in .git/lost-found/other. You get the contents without the filenames. Don't run git gc in the meantime. Anything you changed but hadn't staged is gone, unless your editor kept a copy.
thank you thank you. 14 files. file names were easy to work out from the contents
reflog is for commits, for anyone reading this later. It doesn't help here because nothing was committed. Which is why you commit often and squash later.
yes yes i know. wip commits from now on