1. 程式人生 > 其它 >git回滾到指定版本

git回滾到指定版本

技術標籤:git

1.使用如下命令檢視提交的日誌,找到要回滾的commit id

  git log --pretty=oneline

在這裡插入圖片描述
2.使用如下命令hard後邊跟上commit對於的id

git reset --hard 4ff191db3********f6a7721175ea08f3e

3.使用如下命令強制推送到git上

git push -f

4.檢視遠端git上已經回滾到指定commit的版本了