I was using git for the first time, I had a directory with several programs written in it and did the following steps
- I did
git add . - then
git commit, then it i got a messageAborting commit due to empty commit message. - Then i thought, let me commit group of files under common message. So i thought of removing all the added files.
- So i did
git rm -r -f - When i do a
lsi have lost all my code. Is there any way that i can get them back, to my foolishness i don't have backup copy even.
Things that i have followed till now
I googled out some found some of the command but they are not working
git stash if i type this command i get
fatal: bad revision 'HEAD' fatal: bad revision 'HEAD' fatal: Needed a single revision You do not have the initial commit yet
git reset HEAD, if i type this command i get
Fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree. Use '--' to separate paths from revisions
I really need to get those files back!
Steps that i followed to create GIT
mkdir BareRepo- In
BareRepoDirectory i didgit init,git status,git config --bool core.bare true - Then i cloned the BareRepo
git clone BareRepo/ Programs/ - In the
Programsdirectory i did all the above said thing