Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3311012
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:49:36+00:00 2026-05-17T21:49:36+00:00

So I did a bad thing. Somewhere during the course of making a bunch

  • 0

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 git@codaset.com:robwilkerson/cakephp-polyclip-plugin.git
! [rejected]        develop -> develop (non-fast-forward)
error: failed to push some refs to 'git@codaset.com: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.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:49:36+00:00Added an answer on May 17, 2026 at 9:49 pm

    Did you add -f (force) to the git push? Without that flag you can’t overwrite “old” commits.

    -f, --force
           Usually, the command refuses to update a remote ref that is not an
           ancestor of the local ref used to overwrite it. This flag disables
           the check. This can cause the remote repository to lose commits;
           use it with care.
    

    It can get messy if others already pulled from those repository.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using m2eclipse to manage maven projects. Somehow I did a bad thing, and
I recently had to re-install my operating system (Ubuntu). The only thing I did
f'I have the following: A---B---C-----D-- branch dev \--C'-E-/ branch test I did it bad:
Did you used Dynamic websites before? you see its a good way for making
Did not have luck with these examples: Javascript File remove Javascript FSO DeleteFile Method
Did actually someone make already a tutorial that shows how to customize an UITableView?
I am using _stati64() in my file manager so that I can get the
maybe it has been solved somewhere on this website but I did not find
Did some searches here & on the 'net and haven't found a good answer
Did you ever have the following situation: you need to store information, but a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.