恢复git但是合并但没有给出-m选项

时间:2018-03-16 06:27:03

标签: git revert

我已提交并推送2更改现在我想从git恢复一次推送

我已经使用了这个

sudo git revert 1c3268d4b69dc6ca9dd89e92b513f5edb194978c

但它告诉我

Commit 1c3268d4b69dc6ca9dd89e92b513f5edb194978c is a merge but no -m option was given

git log

commit b3972be60fb2f2c70b56f470c8327152e773f725
Author: jaskarans <jask@sl.com>
Date:   Fri Mar 16 11:25:49 2018 +0530

    remove error 1599

commit 1c3268d4b69dc6ca9dd89e92b513f5edb194978c
Merge: 5d6fdd4 7531be0
Author: jaskarans <jask@sl.com>
Date:   Fri Mar 16 10:23:58 2018 +0530

    Merge branch 'development' of https:// abc.com:8888/development/asdf into jQuery_update

commit 5d6fdd48cdd0b402913bf70fb64be83e676e8b21
Author: jaskarans <jask@sl.com>
Date:   Fri Mar 16 10:21:26 2018 +0530

1 个答案:

答案 0 :(得分:8)

如果您的提交是合并类型,您尝试还原,那么您无法在SourceTree中执行此操作。合并提交不能被挑选/恢复。

要还原合并提交,您必须遵循以下语法

git revert -m 1 <commit-hash> 
git commit -m "Reverting the last commit."
git push -u origin master