How can I undo my last git add/commit ?

Posted by dan on Stack Overflow See other posts from Stack Overflow or by dan
Published on 2010-12-21T10:27:19Z Indexed on 2010/12/21 10:54 UTC
Read the original article Hit count: 439

Filed under:
|
|
|

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

© Stack Overflow or respective owner

Related posts about git

Related posts about repository