Use the following command to remove a file or pattern from git:
git rm -r --cached my-file.js
You would then update your .gitignore to exclude this file or pattern