Undo ANY git mistake in 3 seconds with a beautiful TUI
Never lose work again. git-time-machine makes git reflog visual, interactive, and actually usable.
You just:
- ๐ฅ Force pushed and lost commits
- ๐ฅ Did
git reset --hardby accident - ๐๏ธ Deleted a branch you needed
- ๐คฆ Rebased wrong and broke everything
- ๐ฑ Can't remember what you did 5 minutes ago
Current solution: Dig through git reflog, copy cryptic hashes, pray you picked the right one.
Better solution: git-time-machine ๐ฏ
Navigate your git history like a time traveler. One key to restore.
cargo install git-time-machinegit clone https://github.com/dinakars777/git-time-machine
cd git-time-machine
cargo install --path .brew install git-time-machine# Launch in any git repository
git-time-machine
# Show all reflog entries (default: last 50)
git-time-machine --all| Key | Action |
|---|---|
โ / k |
Move up |
โ / j |
Move down |
Enter |
Restore to selected state |
q / Esc |
Quit |
- โ Visual Timeline - See your entire git history at a glance
- โ Relative Timestamps - "5m ago", "2h ago", "yesterday"
- โ One-Key Restore - Press Enter, done
- โ Vim Keybindings - j/k navigation
- โ Beautiful TUI - Built with Ratatui
- โ Lightning Fast - Written in Rust
- โ Zero Config - Just worksโข
# Oh no! You did this:
git reset --hard HEAD~5
# No problem:
git-time-machine
# Navigate to "6m ago", press Enter
# All commits restored โจ# Deleted the wrong branch
git branch -D feature-branch
# Recover it:
git-time-machine
# Find the last commit on that branch
# Press Enter, then:
git checkout -b feature-branch# Rebase went wrong
git rebase main
# Conflicts everywhere...
# Undo it:
git-time-machine
# Go back to before rebase
# Press Enter, start overgit-time-machine is a wrapper around git reflog that:
- Parses your reflog history
- Displays it in an interactive TUI
- Lets you preview and restore any state
- Executes
git reset --hard <hash>when you press Enter
It's just git under the hood - no magic, no risk.
Contributions welcome!
Ideas for future versions:
- Show file diffs inline
- "Panic mode" - undo last N minutes
- Branch visualization
- Stash recovery
- Search/filter commits
- Export timeline as JSON
MIT ยฉ Dinakar Sarbada
If this saved you once, give it a star! โญ
Made with โค๏ธ and Rust | Report Bug | Request Feature
