To remove a file from the current commit or HEAD but if you want remove entirely from the repository’s history then you need to run couple of commands.
git filter-branch --index-filter \
'git rm -rf --cached --ignore-unmatch path_to_file' HEADThis will rewrite your
githistory to remove the file