Remove a specific changeset from Git repository altogether?

Is it even possible to remove a particular changeset from a Git repository altogether. I want to do this because there was a commit while ago that added some binary files that are absolutely useless for source code management.

I can understand if this is impossible to do given the fact that the commit nodes have parents and a specific history, but I guess it will not hurt to ask.

  • Git pull error: “fatal: Couldn't find remote ref master” from Heroku
  • How to list all tags for commits which created a set of files in git?
  • git: Simple solution for pushing between working copies
  • How to rename a git repository?
  • Git: merge master to new branch and clear out master
  • gpg signing support for JGIT
  • And the answer is no for questions that ask “can you just clone new copy of the time before that commit occurred and start from there again?”.

  • Xcode 5: Pushing and pulling from new GitHub repository does not work
  • No such file or directory - git ls-files
  • Git - exclude specific commit and push
  • Powershell Command to Run “git gc” in all sub-directories that are git repos
  • Remove directory/file from Git cache using GitKraken
  • How to highlight files in the side bar that have been modified since the last commit with Git in Sublime Text 3 (like Atom does )?
  • One Solution collect form web for “Remove a specific changeset from Git repository altogether?”

    Use git rebase -i <commit-id>, there id is a commit before the changeset you want to remove. It will open a list of commits between the head and the changeset, delete from the list the commit you want and continue. When this commit will be “detached”, it means it will be floating in the repository until it’s garbage collected. You could use git gc to force it.

    However, you should remember, that all clones of the repository will be diverged, and should be rebased too after it.

    Git Baby is a git and github fan, let's start git clone.