Type in below commands in the terminal or equivalent:
git rm -r --cached Folder_name (remove the directory from git but not delete it from the filesystem/locally)
git commit -m "remove unused directory"
git push origin <your-git-branch> (can be master or develop or others)
Note that the currently accepted answer does NOT delete it completely and it will remain in the history. If you want it to be deleted completely from your history, i.e., from all past commits in which this directory exists in, you can use either of these ways:
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch node_modules" HEAD
In both cases however, notice that you're re-writing the history which might be a nightmare when working in a team... . So either use this in your own local branch/environment, or make sure you know no one has any better options and let all of your mates know about it beforehand.