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.
Asked
Active
Viewed 61 times
2 Answers
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.
-
I found that one before posting this, but it did not work for what I am doing. – Patrick Feb 21 '13 at 22:15
-
Did you look at more than the accepted answer? There were a lot of alternatives in the high-voted answers. – ajp15243 Feb 21 '13 at 22:36