Git undo last commit.

Posted by Justin on Stack Overflow See other posts from Stack Overflow or by Justin
Published on 2010-05-24T14:24:38Z Indexed on 2010/05/24 21:01 UTC
Read the original article Hit count: 173

Filed under:

I merged the wrong way between two branches. I then ran the following:

git reset --hard HEAD^

I am now back at the previous commit (which is where I want to be). Was that the correct thing to do?

The bad commit is still in the repository, is that okay or should I do something else to remove it from the repository?

I have not pushed or committed anything else yet.

© Stack Overflow or respective owner

Related posts about git