Skip to content

Commit 5649777

Browse files
docs: Update docs for undo command (#121)
2 parents 38d52af + 85db61a commit 5649777

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

docs/usage.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ tmpo resume --project "Client Work" # Resume a global project from anywhere
7777
- Quickly restart the same task
7878
- Resume a global project from any directory
7979

80+
> [!TIP]
81+
> 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.
82+
8083
### `tmpo status`
8184

8285
View the current tracking session with elapsed time.
@@ -423,6 +426,40 @@ tmpo delete --show-all-projects # Select project first, then entry
423426
- Delete test/accidental entries
424427
- Clean up your time tracking history
425428

429+
### `tmpo undo`
430+
431+
Revert the most recent time-tracking action in case of a mistake. A single confirmation prompt is shown before any change is made.
432+
433+
**Supported actions:**
434+
435+
| Action | What undo does |
436+
|---------------|---------------------------------------------------|
437+
| `tmpo start` | Deletes the entry that was just created |
438+
| `tmpo stop` | Re-opens the stopped entry as a running timer |
439+
| `tmpo pause` | Re-opens the paused entry as a running timer |
440+
| `tmpo resume` | Deletes the new entry that was created to resume |
441+
| `tmpo manual` | Deletes the manually created entry |
442+
| `tmpo delete` | Restores the deleted entry with its original data |
443+
444+
**Examples:**
445+
446+
```bash
447+
tmpo undo
448+
# ↩️ Last action: Stopped tracking my-project
449+
#
450+
# Undo this action? [y/N]: y
451+
# ↩️ Undo successful.
452+
453+
tmpo undo
454+
# ⚠️ Nothing to undo.
455+
```
456+
457+
**Notes:**
458+
459+
- Only the single most recent action can be undone — tmpo does not maintain a full history stack
460+
- Running `tmpo undo` a second time will show "Nothing to undo"
461+
- Undoing a `stop` or `pause` will fail if another timer is already running — stop it first with `tmpo stop`
462+
426463
### `tmpo export`
427464

428465
Export your time tracking data to CSV or JSON.

0 commit comments

Comments
 (0)