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

  • Home
  • SEARCH
  • 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 421465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:59:09+00:00 2026-05-12T18:59:09+00:00

I accidentally committed some large test wav files into my repository and they are

  • 0

I accidentally committed some large test wav files into my repository and they are using up a lot of space on my Github account. How can I remove these files from the history?

Note: these files were committed some time ago and are not on the HEAD commit.

  • 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-12T18:59:09+00:00Added an answer on May 12, 2026 at 6:59 pm

    There’s no way to remove them without modifying the history, so if anyone’s pulled the changes, you may have to deal with that mess – see recovering from upstream rebase in man git-rebase. This can be pretty bad, depending on your workflow – one way or another you’ll probably have to make everyone aware that they need to switch to the “new” master branch, rebasing any work in progress on top of it.

    If the commit were still on the tip, you could reset to the commit before it:

    git reset --hard HEAD^
    

    or amend it:

    git rm test.wav
    git commit --amend
    

    But since it’s no longer at the tip, your best bet is probably to probably do it with an interactive rebase:

    git rebase -i <commit-before-mistake>
    

    Change “pick” to “edit” on the commit you want to fix, then have at it! (or even remove the whole commit if that’s okay)*

    After you finish doing whichever of these you pick, you’ll have to force the push, since it’s no longer a fast-forward:

    git push -f origin
    


    * If you’ve subsequently committed modifications to these files, you’ll get issues as you continue on in the rebase. They should be straightforward to deal with, since you just want the files gone. Of course, if there’ve been a hundred commits since then that’ll all cause conflicts, you could have a look at git-filter-branch. The relevant example from the man page is:

    git filter-branch --index-filter ’git rm --cached --ignore-unmatch filename’ HEAD
    

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

Sidebar

Related Questions

I accidentally committed too many files to an SVN repository and changed some things
I accidentally committed some changes to the repository that were not complete. I do
My central repository is stored on an 8GB USB stick. I accidentally committed some
I have accidentally committed the .idea/ directory into git. This is causing conflicts everywhere
I've accidentally committed bunch of files locally, but didn't pushed. So basically what I
When removing files from a Git repository I accidentally also removed a file that
I just committed some changes into one of my feature branches (feedback_tab) then, checked
I accidentally added many files (test files) which I do not want them to
I accidentally committed the wrong files to Git , but didn't push the commit
I am currently using TortoiseHg (Mercurial) and accidentally committed an incorrect commit message. How

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.