undo, continue, abort¶
These commands are your safety net. Use undo to reverse the last git-city command after it finished, and use continue / abort to deal with a sync that paused on a merge conflict. To re-read where a paused sync stands, run git city info — it leads with the pause banner.
They split cleanly into two situations:
| Situation | Commands |
|---|---|
| The last command finished, but you want it gone | undo |
| A sync is paused mid-rebase on a conflict | continue, abort (inspect with info) |
Note
undo and the paused-operation commands are mutually exclusive. undo works on a completed operation; continue / abort work on a paused one. While an operation is paused, undo refuses (see below) — finish or abort the pause first.
undo¶
undo reverses the last git-city command. It is built into the engine: every mutating command records how to reverse each step before that step runs (see reversible operations), and undo replays those captured inverses in reverse order. That makes it powerful — it can restore moved refs, recreate deleted branches, and even restore branches that were force-pushed or deleted on the remote.
Single-level¶
undo is single-level. There is one slot of run-state, and each git-city command overwrites it. You can undo the most recent command, but not the one before it — running a second undo in a row does not walk further back; it would reverse the first undo.
Tip
Think of undo as a one-step rewind, not a history. If you need to step back several operations, undo, inspect, and decide again at each step rather than expecting a deep stack.
What undo refuses to do¶
undo is deliberately conservative: it refuses rather than risk destroying work.
| It refuses when… | Why |
|---|---|
| the working tree is dirty | reversing refs could clobber uncommitted changes — commit or stash first |
| undoing would delete a branch whose commits exist on no other branch | those commits would become unreachable |
| an operation is currently paused | the slot holds a half-run plan, not a completed one — use continue or abort |
It also will not delete a remote branch that git-city did not create. Combined with --force-with-lease everywhere, that means undo cannot silently throw away work it does not own.
Like every mutating command, undo accepts --dry-run to print the exact git commands it would run without executing anything.
→ How the engine captures and replays inverses
When a sync pauses¶
A rebase-first sync can hit a merge conflict. When it does, git-city stops cleanly, leaves the rebase in progress for you to resolve, and persists the remaining plan so the operation can be resumed or rolled back later.
git-city: sync add-login is paused.
stopped on: git rebase --onto main <base> add-login
resolve the conflict and `git add`, then:
git city continue resume the operation
git city abort undo everything and return to the start
git city info show this and the repo status
The message tells you everything you need: the operation that paused, the exact step it stopped on, and your options from here.
→ Understanding and resolving conflicts
continue¶
Once you have resolved the conflicted files and staged them with git add, run git city continue to resume. git-city finishes the rebase and runs the rest of the persisted plan (including the final force-push) exactly where it left off.
abort¶
abort rolls the whole operation back, returning you to the state you started in — as if the sync had never run. Reach for this when the conflict turns out to be more than you want to deal with right now.
Both continue and abort accept --dry-run, which prints what they would do (the rebase action plus the remaining or reversing steps) without touching anything — handy when you want to see how a paused operation will finish or unwind before committing to it.
Seeing the paused state again¶
When a sync is paused, git city info leads with the same pause banner shown above, then prints the repo dashboard. It is read-only — use it any time you lose track of where a paused sync stands. (git city status is a hidden alias of info.)
| Command | Use it when |
|---|---|
git city continue |
you have resolved the conflict and git added the result |
git city abort |
you want to give up and return to the starting state |
git city info |
you just want to see the paused state again |
Warning
While a sync is paused you are in the middle of a real Git rebase. Don't start another git-city operation until you continue or abort — and remember that undo refuses to run until the pause is cleared.
See also¶
- sync — the command that can pause on a conflict
- Conflicts — resolving the rebase and choosing continue vs. abort
- Reversible operations — how undo, continue, and abort are all one engine