I accidentally committed an unwanted file (filename.orig
while resolving a merge) to my repository several commits ago, without me noticing it until now. I want
Definitely, git filter-branch
is the way to go.
Sadly, this will not suffice to completely remove filename.orig
from your repo, as it can be still be referenced by tags, reflog entries, remotes and so on.
I recommend removing all these references as well, and then calling the garbage collector. You can use the git forget-blob
script from this website to do all this in one step.
git forget-blob filename.orig