I am new to git and I just made a silly mistake that I deleted some important files with the "rm *" command. However, I used "git add" to add these files, but not to commit. delete has not been added yet. So, is there a way to recover these deleted files.
Any suggestions or answers would be appreciated. Thank you
Since the files are already in your staging area (index), just pass them in with git commitno arguments. This will capture the contents of the index regardless of the current state of the working tree.
git commit
git reset --hard ( , ) git checkout FILE1 FILE2..., .
git reset --hard
git checkout FILE1 FILE2...
git fsck --lost-found, , . "blob" , , . , .
git fsck --lost-found
4815162342, , , , git checkout , , .
git checkout
, - git fsck --lost-found, user4815162342 .