An easier way to remove a file that has been added to the last commit by mistake:
git rm --cached <wrong_file>
git commit --amend
This doesn't delete the file, though. Dropping '--cached' would delete it.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.