0

I accidentally committed a HUGE image to a repo when I meant to commit a smaller one. I don't want that in the repo from now on. I haven't synched yet.

Using GitHub for Mac, I went in history and did "Roll back to this commit" but I don't think that's doing what I need, since it's rolling to immediately after I committed.

I tried rolling back to the commit before it, and I get an error:

error: Your local changes to the following files would be overwritten by merge:
    img/image.jpg
Please, commit your changes or stash them before you can merge.
Aborting
 (128)

The thing is there aren't changes to commit or stash. How do I keep this giant file out of the repo before I sync?

lotstolearn
  • 91
  • 10

1 Answers1

1

You can delete that file from your repo with:

git rm --cached img/image.jpg
René Höhle
  • 26,716
  • 22
  • 73
  • 82