Use git log
to find the revision you want to rollback to, and take note of the commit hash.
After that, just git checkout <hash>
. Example:
$ git log
commit 89915b4cc0810a9c9e67b3706a2850c58120cf75
Author: Jardel Weyrich <suppressed>
Date: Wed Aug 18 20:15:01 2010 -0300
Added a custom extension.
commit 4553c1466c437bdd0b4e7bb35ed238cb5b39d7e7
Author: Jardel Weyrich <suppressed>
Date: Wed Aug 18 20:13:48 2010 -0300
Missing constness.
$ git checkout 4553c1466c437bdd0b4e7bb35ed238cb5b39d7e7
Note: moving to '4553c1466c437bdd0b4e7bb35ed238cb5b39d7e7'
which isn't a local branch
If you want to create a new branch from this checkout, you may do so
(now or later) by using -b with the checkout command again. Example:
git checkout -b <new_branch_name>
HEAD is now at 4553c14... Missing constness.
That way you don't lose any informations, thus you can move to a newer revision when it becomes stable. Note this will not allow you to commit at this same point. If you wish so, create a new branch as mentioned on the message printed above.