I assume you're looking to remove the other files from the branch's history entirely, rather than just a git rm {model_frontend,plot_model,cool_use_for_model,}.py
commit. If that covers what you need, though, definitely just do that rather than messing around with your repo's history.
Fair warning: Because this involves rewriting the files out of old commits, your git history will be rewritten and the branches will not agree on the contents of commits. This can make things messy. If you don't know what you're doing, do not do this.
That said, if you create the branch my-core-branch
to do this in, then git filter-branch --tree-filter 'rm -f model_frontend.py plot_model.py cool_use_for_model.py' my-core-branch
will rewrite history in my-core-branch
to remove those files, but leave your other branches' history. The hashes for commits touching those files and also files you're not deleting will no longer match between branches, obviously, so again, for any git newbies reading this, use at your own risk.