So I did a bad thing.
Somewhere during the course of making a bunch of changes, I realized that a unintended file had snuck into a commit or two. Because I didn't realize this until later, the commits that included the file have now been pushed to the remote. I want & need the commits, I just want to remove this specific file from them.
What I need to do, of course, is to reach into every nook & cranny of my tree (local and remote) and obliterate that file. I've tried a few things using filter-branch
and filter-tree
, but when I attempt to push the changes get rejected.
What are my options? What am I doing wrong?
Thanks.
UPDATE
At max's request, here's the message I get when attempting to push:
$ git push origin develop
To [email protected]:robwilkerson/cakephp-polyclip-plugin.git
! [rejected] develop -> develop (non-fast-forward)
error: failed to push some refs to '[email protected]:robwilkerson/cakephp-polyclip-plugin.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details.