ログ日記

作業ログと日記とメモ

git revert で 複数のコミットを取り消した状態でコミットする

git revert --help を見る。

EXAMPLES
       git revert HEAD~3
           Revert the changes specified by the fourth last commit in HEAD and
           create a new commit with the reverted changes.

       git revert -n master5..master2
           Revert the changes done by commits from the fifth last commit in
           master (included) to the third last commit in master (included),
           but do not create any commit with the reverted changes. The revert
           only modifies the working tree and the index.

git revert -n aaaaaa..bbbbbb
でaaaaaaからbbbbbbまでの変更を元に戻す。-n オプションは自動コミットしない。