blog icon indicating copy to clipboard operation
blog copied to clipboard

git push代码到远程仓库后,想回退到指定commit

Open chenshenhai opened this issue 8 years ago • 0 comments

git push代码到远程仓库后,想回退到指定commit


/* 1. 先查看commit提交记录 */
git log

/* 2. 找到要的commit版本的加密编码,然后进行revert  */
git  revert  xxxxx //xxxxx 为commit 生成的编码

/* 3. 利用差异 验证回退是否成功 */
git  diff  xxxx    //xxxxx 为刚才回退到的commit编码

/* 如果没有差异,就证明回退成功 */
/* 4. push 远程分支/主干 */
git push origin master


chenshenhai avatar May 29 '16 14:05 chenshenhai