--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 --abortRelated terms
- merge conflict — The situation where two branches changed the same lines differently since their merge base, so Git cannot combine them and asks you to choose.
- rebase — Moving a series of commits so they start from a different commit, by replaying each one as a new commit with a new ID.
- merge — Combining the work of two branches into one, either by moving a branch forward (a fast-forward) or by recording a merge commit.
Taught in
- Rebase: The Same Work, A Different History — Advanced Git Internals & Distributed Workflows
- Resolving A Conflict, Line By Line — Advanced Git Internals & Distributed Workflows