This post is more for me than for anyone else. I keep finding myself forgetting to add something to my .gitignore, and I have to search for the solution all over again. So, here’s how to fix it:
git rm -r --cached .
Then, just re-commit it all. Simple as that! And for the record, I got this solution from this Stack Overflow.