指定のファイルと、そのコミット履歴の全てを削除
git filter-branch --force --index-filter "git rm --cached --ignore-unmatch env.gs" -- --all
※env.gs
の部分を、任意のファイルに書き換えてください。

リモートにプッシュ
git push --all --force origin
劇薬コマンドのため慎重&バックアップ必須
コマンドを間違えたときは、サルベージ不可になります。
参考サイト
https://zenn.dev/flyingbarbarian/articles/aaf59c07b71a34
https://oigami.hatenablog.com/entry/2015/01/17/165918
Discussion