How can I undo my last git add/commit ?
- by dan
I edited a file and did:
git add file.py
git commit -m 'fixed bug'
I then edited another file and performed a minor bug fix. I don't want two commits, one after the other, showing 'bug fix'. I want one commit with 'bug fixes'.
How can I undo the last add/commit and change the first commit message?
I was looking at the git reset, git revert, git undo commands but I don't want to screw up my repo with a guess
EDIT: Found out how to do it: http://www.gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html