If you've already committed a bunch of unwanted files, you can unstage them and tell git to mark them as deleted (without actually deleting them) with
git rm --cached -r .
--cached
tells it to remove the paths from staging and the index without removing the files themselves and -r
operates on directories recursively. You can then git add
any files that you want to keep tracking.