标签:log format html 相对 har main div 分享 res
本文转载自:http://blog.chinaunix.net/uid-28621021-id-3487102.html
撤消历史提交
1
git revert commit_ID
例子:提交历史如下
ss@ss:/work/test$ git log
commit 70869ac8cc36c05267aad41954f89d068d2d8142
Author: ss
Date: Thu Mar 21 20:12:58 2013 +0800
new a
commit 226e1a70d720f47d21d3664688d9dc34665ba84f
Author: ss
Date: Thu Mar 21 20:05:36 2013 +0800
commit c
commit ff45af7db705904bc49fc09679b2c384ce778d1a
Author: ss
Date: Thu Mar 21 20:05:23 2013 +0800
commit b
commit 76e846f8ee0106840767d5522c7d33d7f752527b
Author: ss
Date: Thu Mar 21 20:05:08 2013 +0800
commit a
commit 8e7979f6617ae9fc6ae3666002bf17482bd10e28
Author: ss
Date: Wed Feb 20 20:06:09 2013 +0800
Iitial
如果我想撤消
commit 226e1a70d720f47d21d3664688d9dc34665ba84f
Author: ss
Date: Thu Mar 21 20:05:36 2013 +0800
commit c
这笔提交;则使用命令:git revert 226e1a70d720f47d21d3664688d9dc34665ba84f
效果如下:
commit 40f83cb1fa45702ec31bcdd4426580551edfae8e
Author: ss <ss.ss< span="">.com>
Date: Thu Mar 21 20:13:07 2013 +0800
Revert "commit c"
This reverts commit 226e1a70d720f47d21d3664688d9dc34665ba84f.
commit 70869ac8cc36c05267aad41954f89d068d2d8142
Author: ss
Date: Thu Mar 21 20:12:58 2013 +0800
new a
commit 226e1a70d720f47d21d3664688d9dc34665ba84f
Author: ss
Date: Thu Mar 21 20:05:36 2013 +0800
commit c
commit ff45af7db705904bc49fc09679b2c384ce778d1a
Author: ss
Date: Thu Mar 21 20:05:23 2013 +0800
commit b
这样在这一比提交的东西将会被撤销
2
若想撤消
commit 70869ac8cc36c05267aad41954f89d068d2d8142
Author: ss
Date: Thu Mar 21 20:12:58 2013 +0800
new a
commit 226e1a70d720f47d21d3664688d9dc34665ba84f
Author: ss
Date: Thu Mar 21 20:05:36 2013 +0800
commit c
commit ff45af7db705904bc49fc09679b2c384ce778d1a
Author: ss
Date: Thu Mar 21 20:05:23 2013 +0800
commit b
这三笔提交
可以用命令
git reset --hard 76e846f8ee0106840767d5522c7d33d7f752527b 这笔ID为commi a
git reset --soft 70869ac8cc36c05267aad41954f89d068d2d8142
git commit -m "cccc"
标签:log format html 相对 har main div 分享 res
原文地址:http://www.cnblogs.com/zzb-Dream-90Time/p/6728034.html