[Git] Revert to a old commit

You can do 

git log

first to check which commit message you want to revert to.

For example 'xxxxx123' is the commit id we want to revert to.

Then do:

git revert --no-commit xxxxx123..HEAD
git commit
原文地址:https://www.cnblogs.com/Answer1215/p/14102827.html