181
git rmwill remove entries from the staging area. This is a bit different fromgit reset HEADwhich "unstages" files. By "unstage" I mean it reverts the staging area to what was there before we started modifying things.git rmon the other hand just kicks the file off the stage entirely, so that it's not included in the next commit snapshot, thereby effectively deleting it.By default, a
git rm filewill remove the file from the staging area entirely and also off your disk > (the working directory). To leave the file in the working directory, you can usegit rm --cached.
But what exactly is the difference between git rm --cached asd and git reset head -- asd?