It is very common to make a git commit and then realizing that some files must be removed from the commit. It’s easy to do so.
git rm --cached <file_name>
git commit --amend -m "Commit message"
Remote repository 🔗
This change rewrites the git history, and will create problem on shared branches if other people has already pulled the changes.
For this reason, if the changes were pushed to remote, you should make a git pull --rebase before making git push. The alternative is to make a git push --force, which is rarely a good idea.