Tower's Undo Feature: One-Click Recovery from Accidental Git Force-Push
When a force push rewrites shared history, Tower's visual Undo button can restore the previous state in a click. This post explains how it works, a concrete recovery example, and where the feature falls short.
30 Jul 2025, 05:16 UTC

You just ran git push --force on a shared branch and watched the CI pipeline turn red. Team members lost commits, merge histories snapped, and the usual Git reflog dance felt like digging through a tunnel without a map. If you have Tower, the pain is mitigated by a single button.
How Tower's Visual Undo Works
Tower records a lightweight metadata log stored in its application support folder alongside each executed Git command. The log maps UI actions to underlying SHA references, allowing the interface to replay an inverse operation when you click Undo. This happens entirely on your machine; no server-side configuration or reflog replication is required, and the feature works offline for local repositories.
Version Support and Parity
The Undo feature is available in Tower 10+ on macOS and Tower 3+ on Windows, both requiring Git 2.30+. Because it operates as a client-side safety layer rather than a Git extension, it remains compatible with any remote service GitHub GitLab Bitbucket or self-hosted without depending on server features like reflog replication.
Recovering from an Accidental Force Push in One Click
Imagine you force-pushed a rewritten history to origin main by mistake. In Tower's activity view the command appears with an Undo button nearby. Clicking Undo Force Push triggers the reversal using the SHA snapshot taken before the original push.
git push --force-with-lease origin main:mainTower's Show Command output displays the exact Git command that will run; in this case it is git push --force-with-lease origin main:main which uses the pre push SHA stored in the metadata log to safely restore the remote branch.
- Where to run: Within Tower's graphical interface no shell access required.
- Required permissions: Local repository write access is sufficient the command runs against the remote configured in the repo.
- Meaningful placeholders: origin and main refer to your remote name and branch respectively.
- Expected checks: After the undo completes the remote branch history should match the local snapshot captured before the force push.
- Relevant risks: If other pushes occurred after the one you are undoing or if the remote has server side hooks protecting the branch the force with lease operation may be rejected. Undo also cannot proceed if the underlying objects have been GC pruned.
What Undo Can't Do Trade-offs and Limits
- Cannot reverse resolved merge conflict commits after they are saved.
- Cannot recover objects that have been garbage collected away.
- May fail on protected branches with server side hooks or policies that reject force pushes.
- The metadata log grows unbounded over time manual clearance via Tower preferences is needed for large repositories with frequent commits.
Tower is a commercial product licensing costs may affect team adoption. The Undo metadata is not portable across machines or users if you switch workstations the recovery history does not transfer. Additionally Undo does not replace Git's native reflog environments without Tower still require familiarity with git reflog for similar recovery tasks.
Verifying the Feature Yourself
To test the feature without risking production work download the free trial from fournova.com/tower create a test repository perform an accidental git push --force then use Tower's Undo button and inspect the Show Command output to see the exact git push --force-with-lease invocation. Check Tower's release notes under Help Release Notes for any version specific Undo improvements in 10 plus macOS or 3 plus Windows. Consult the online documentation section Undoing Changes for current supported operations and keyboard shortcuts. As an edge case attempt Undo after a merge conflict resolution commit observe that Tower disables the action and shows a tooltip explaining the limitation.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.