From 85db61ad18d761f52af372d1eaf3ef373c803b26 Mon Sep 17 00:00:00 2001 From: Dylan Ravel Date: Sat, 9 May 2026 13:02:22 -0700 Subject: [PATCH] Update docs for undo command --- docs/usage.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/docs/usage.md b/docs/usage.md index 153898c..74736ee 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -77,6 +77,9 @@ tmpo resume --project "Client Work" # Resume a global project from anywhere - Quickly restart the same task - Resume a global project from any directory +> [!TIP] +> Made a mistake? Run `tmpo undo` to instantly revert your last action — start, stop, pause, resume, manual entry creation, or deletion. See [`tmpo undo`](#tmpo-undo) for details. + ### `tmpo status` View the current tracking session with elapsed time. @@ -423,6 +426,40 @@ tmpo delete --show-all-projects # Select project first, then entry - Delete test/accidental entries - Clean up your time tracking history +### `tmpo undo` + +Revert the most recent time-tracking action in case of a mistake. A single confirmation prompt is shown before any change is made. + +**Supported actions:** + +| Action | What undo does | +|---------------|---------------------------------------------------| +| `tmpo start` | Deletes the entry that was just created | +| `tmpo stop` | Re-opens the stopped entry as a running timer | +| `tmpo pause` | Re-opens the paused entry as a running timer | +| `tmpo resume` | Deletes the new entry that was created to resume | +| `tmpo manual` | Deletes the manually created entry | +| `tmpo delete` | Restores the deleted entry with its original data | + +**Examples:** + +```bash +tmpo undo +# ↩️ Last action: Stopped tracking my-project +# +# Undo this action? [y/N]: y +# ↩️ Undo successful. + +tmpo undo +# ⚠️ Nothing to undo. +``` + +**Notes:** + +- Only the single most recent action can be undone — tmpo does not maintain a full history stack +- Running `tmpo undo` a second time will show "Nothing to undo" +- Undoing a `stop` or `pause` will fail if another timer is already running — stop it first with `tmpo stop` + ### `tmpo export` Export your time tracking data to CSV or JSON.