1

I have a file that I accidentally added to my most recent commit. I want to remove the changes, but leave the file in the repository. That is because it is a generated sass stylesheet and I always have merge problems with it. Since the server will regenerate it anyway I would really like to just avoid committing it.

Patrick
  • 3,302
  • 4
  • 28
  • 47

2 Answers2

1

Make a new commit that puts everything in the state you want it to be in, then squash it (via git rebase -i) into your most recent commit.

Carl Norum
  • 219,201
  • 40
  • 422
  • 469
0

The answers in this question will likely contain what you need and more for undoing a local commit.

Community
  • 1
  • 1
ajp15243
  • 7,704
  • 1
  • 32
  • 38