How can I roll back 1 commit?

Posted by n179911 on Super User See other posts from Super User or by n179911
Published on 2009-09-03T21:23:58Z Indexed on 2012/10/12 9:42 UTC
Read the original article Hit count: 162

Filed under:

I have 2 commits that I did not push:

$ git status
# On branch master
# Your branch is ahead of 'faves/master' by 2 commits.

How can I roll back my first one (the oldest one), but keep the second one?

 $ git log
commit 3368e1c5b8a47135a34169c885e8dd5ba01af5bb
...

commit baf8d5e7da9e41fcd37d63ae9483ee0b10bfac8e
...

From here:

http://friendfeed.com/harijay/742631ff/git-question-how-do-i-rollback-commit-just-want

Do I just need to do:

git reset --hard baf8d5e7da9e41fcd37d63ae9483ee0b10bfac8e

That is?

© Super User or respective owner

Related posts about git