I have just added a bunch of files after I git init. Now I notice that I've made a mistake and want to undo all of them at once. How can I do that?
$ git init
$ git add .
$ git status
# On branch master
#
# Initial commit
#
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
#
# new file: .DS_Store
# new file: .gitignore
# new file: .idea/.generators
# new file: .idea/.name
# new file: .idea/.rakeTasks
# new file: .idea/DAM.iml
...
git rm --cached <file>
will need to specify all files individually. I'd like to do it in a single command. Is it possible?
I did git reset HEAD
, but it doesn't help.
$ git reset HEAD
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions