What I did is as follows:
$ git init
$ git add .
# bunch of unwanted files were also added
$ vim .gitignore
$ git rm -rf *
$ git add .
# but the files were actually deleted from the ./ folder.
Now what i have in the directory are only the .gitignore pattern files. All the necessary files are gone.
As mentioned in this post How to revert a "git rm -r ."?
is git reset HEAD
way to go?
I am not sure i should run this command as i have not made any commits till now.