You can use git forget-blob
.
The usage is pretty simple git forget-blob file-to-forget
. You can get more info here
It will disappear from all the commits in your history, reflog, tags and so on
I run into the same problem every now and then, and everytime I have to come back to this post and others, that's why I automated the process.
Credits to contributors from Stack Overflow that allowed me to put this together