1、生成与合入patch
#生成patch
git format-patch -1 [commit id]
#合入patch
git apply [patch-file]
2、回退代码到某次 commit
git reset --hard commitID
#生成patch
git format-patch -1 [commit id]
#合入patch
git apply [patch-file]
git reset --hard commitID