git checkout <commit - How do I revert a Git repository to a previous commit?
git checkout / git / git-checkout / git-reset / git-revert
How do I revert from my current state to a snapshot made on a certain commit?
$ git log commit a867b4af366350be2e7c21b8de9cc6504678a61b` Author: Me <email@example.com> Date: Thu Nov 4 18:59:41 2010 -0400 blah blah blah... commit 25eee4caef46ae64aa08e8ab3f988bc917ee1ce4 Author: Me <firstname.lastname@example.org> Date: Thu Nov 4 05:13:39 2010 -0400 more blah blah blah... commit 0766c053c0ea2035e90f504928f8df3c9363b8bd Author: Me <email@example.com> Date: Thu Nov 4 00:55:06 2010 -0400 And yet more blah blah... commit 0d1d7fc32e5a947fbd92ee598033d85bfc445a50 Author: Me <firstname.lastname@example.org> Date: Wed Nov 3 23:56:08 2010 -0400 Yep, more blah blah.
Revert back without keeping the changes:
git reset --hard <commit>
Revert back with keeping the changes:
git reset --soft <commit>
git change commit message of old commit - How to modify existing, unpushed commit messages? git-checkout - git - View 3+ more - How can I reset or revert a file to a specific revision? git fetch - What is the difference between 'git pull' and 'git fetch'? View 3+ more - How do I undo 'git add' before commit? View 3+ more - How do I undo the most recent local commits in Git? git-pull - View 3+ more - How do I force “git pull” to overwrite local files? git-reset - git revert last commit - Delete commits from a branch in Git View 3+ more - How do you roll back (reset) a Git repository to a particular commit? remote-branch - git list remote branches - How do I check out a remote Git branch? git-push - View 3+ more - How do I delete a Git branch locally and remotely? git-branch - View 3+ more - How do I rename a local Git branch? git reset head~1 - How do I use 'git reset --hard HEAD' to revert to a previous commit?