--abort

A flag that cancels a merge, rebase or cherry-pick that has stopped part way, returning everything to how it was before you started.

In more detail

When a merge or rebase stops on a conflict, --abort is always available and loses nothing that was committed. git merge --abort restores the state before the merge; git rebase --abort puts the branch back on its original commits.

Example

git rebase --abort

Related terms

Taught in

References