撤销 git rebase

1、rebase 过程中撤销

git --abort/--continue

2、rebase 成功后撤销

查看本地记录 git reflog 

 $ git reflog
d990bc3 HEAD@{2}: merge origin/develop: Merge made by the 'ort' strategy.                       0652240 HEAD@{3}: rebase (continue) (finish): returning to refs/heads/develop                   0652240 HEAD@{4}: rebase (continue) (pick): bug修复                                             
7943c9f HEAD@{5}: rebase (continue) (pick): 性能优化                                                
e46ec5b HEAD@{6}: rebase (continue) (pick): 性能优化                                                
44c8c8d HEAD@{7}: rebase (continue) (pick): bug修复                                                         
8b4ffc0 HEAD@{8}: rebase (continue) (pick): bug修复                                                         
1282779 HEAD@{9}: rebase (continue) (pick): bug修复                                                    
2942a6b HEAD@{10}: rebase (continue): 增加接口                      
afbda3f HEAD@{11}: rebase (continue): 增加接口                      
0a48081 HEAD@{12}: rebase (continue): 增加接口                      
e6b0dc9 (origin/master, master) HEAD@{13}: rebase (start): checkout e6b0dc9a2c974ebfab7c26ffc56b3612f5dbbe47
c535049 HEAD@{14}: rebase (finish): returning to refs/heads/develop
c535049 HEAD@{15}: rebase (fixup): 增加接口
d17354e HEAD@{16}: rebase (start): checkout b4d875b034f4dac84ceea5e2aba339e94b9deb1e
7c2b2f6 (HEAD -> develop) HEAD@{17}: rebase (finish): returning to refs/heads/develop
7c2b2f6 (HEAD -> develop) HEAD@{18}: rebase (start): checkout b4d875b034f4dac84ceea5e2aba339e94b9deb1e
7c2b2f6 (HEAD -> develop) HEAD@{19}: commit: 命名修改
d17354e HEAD@{20}: commit: 增加接口

rebase 之前的 commit id 为

7c2b2f6 (HEAD -> develop) HEAD@{19}: commit: 命名修改

还原 commit id

git reset --hard 7c2b2f6

你可能感兴趣的:(Git,git,rebase,撤销)