I am new to git, and I just made a stupid mistake, that I deleted some important files by "rm *" command. However, I did use "git add" to add those files, but not commit. the deletion is not added yet. So is there any way to recover these deleted files.
Any suggestions or answers would be appreciated. Thanks.
Since the files are already in your staging area (index), simply commit them using git commit
without any arguments. This will commit the contents of the index regardless of the current state of the working tree.
Then you can use git reset --hard
(if you don't have other changes in the tree you want to keep) or git checkout FILE1 FILE2...
to restore the lost files into your working tree.