git回退代码教程

1、先切一个新分支出来做回退,防止影响原有代码

// 创建分支
git branch 
// 切换分支
git checkout 
  1. 查看commit信息列表
     git log
image.png
  1. 截取部分commit的id,用来回退
  git reset --hard 992a5088
  1. 强制提交
git push --force

other :提交某个commit到其他分支
git cherry-pick commitID

你可能感兴趣的:(git回退代码教程)