1. 对本地代码库进行回滚
1 2 3 4 5 6 |
//查看提交历史,找到要回滚的commit-id git log //回滚到commit-id git reset --hard commit-id //将最近3次的提交都回滚 git reset --hard HEAD~3 |
2. 对远程代码库版本进行回滚
强推.
此时本地的版本落后于远程的版本,使用强制推送覆盖远程分支
1 |
git push -f |
本文为原创文章,版权归Aet所有,欢迎分享本文,转载请保留出处!
你可能也喜欢
- ♥ Git_状况汇总03/19
- ♥ Stash10/02
- ♥ Windows_API_Apply_112/31
- ♥ Visual Studio:内存泄露AddressSanitizer(跨平台)03/14
- ♥ Reading 2021 《肖申克的救赎》12/22
- ♥ Python编程从入门到实践 三05/29