git 回滚代码

 

1. 回退到当前版本

git reset --hard HEAD
git reset --hard commit_id 

2. 回退到上个版本

git reset --hard HEAD^

3. 回退到指定的某个版本(之前的提交还在)

git checkout commit id 

3.自己本地仓库的代码直接推送至仓库,完全以你的提交为准,之前其他人的提交都会被覆盖。

git push -f

 

 
 
posted @ 2022-06-28 15:24  Simon9527  阅读(52)  评论(0)    收藏  举报