git rebase --abort — cancel a rebase in progress
Quick Answer
git rebase --abort
When this happens
CONFLICT (content): Merge conflict in src/app.ts
error: could not apply abc1234... my commit
hint: Resolve all conflicts manually, mark them as fixed with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
The rebase hit a conflict you do not want to resolve right now. --abort restores your branch exactly as it was before you ran git rebase.
Other causes & fixes
Continue the rebase after resolving conflicts
# Edit conflicted files, then:
git add .
git rebase --continue
Skip a single conflicting commit
If a commit is no longer relevant (e.g., already applied upstream), you can skip it.
git rebase --skip
Check whether a rebase is in progress
ls .git/rebase-merge 2>/dev/null && echo "rebase in progress" || echo "no rebase"
Save conflict work before abandoning the rebase
Abort restores the branch to the state before the rebase. If you edited conflict markers and may need those edits later, save a patch or copy the files first.
git diff > rebase-conflict.patch
git status
git rebase --abort
Use --quit only when you want to keep the current files
git rebase --quit stops the rebase bookkeeping without applying the normal abort reset. Use it only when you understand that the current index and worktree will remain as they are.
git status
git rebase --quit
# Inspect the files, then decide whether to commit, stash, or reset
Related