Reputation: 199
I have accidentally forgot to "git add ." a bunch of files that I have created before creating a new branch using "git checkout -b name" and all my un-staged files have been replaced by the files from the head.
Is there any way of retrieving these files? They are not in stash nor they have been commited. Also I am not using an IDE which keeps a history of files.
I have read about "git fsck --lost-found", but before I try that, is there any other way I can revert the un-staged files back onto the filesystem?
Upvotes: 6
Views: 1595
Reputation: 2264
Unfortunately there is no way (not that I have found). Once I did something like that, but I was using Aptana Studio and could recover all the files.
Anyway, a good practice is to maintain your commits small. When you do that you'll never loose more than 30 minutes even with accidents like that.
Upvotes: 1