git回滚到任意版本
先显示提交的log
$ git log -3
commit 4dc08bb8996a6ee02f
Author: Mark <xxx@xx.com>
Date: Wed Sep 7 08:08:53 2016 +0800
xxxxx
commit 9cac9ba76574da2167
Author: xxx<xx@qq.com>
Date: Tue Sep 6 22:18:59 2016 +0800
improved the requst
commit e377f60e28c8b84158
Author: xxx<xxx@qq.com>
Date: Tue Sep 6 14:42:44 2016 +0800
changed the password from empty to max123
回滚到指定的版本
git reset --hard e377f60e28c8b84158
滚回到指定tag
git tag
tag-1.0.0
git reset --hard tag-1.0.0
强制提交
git push -f origin master
done
本文介绍如何使用Git进行版本回滚,包括回滚到特定提交、指定标签及如何强制推送更改。通过具体示例展示了如何查看提交历史记录并选择合适的提交进行回滚。
395

被折叠的 条评论
为什么被折叠?



