# ๐ฐ๏ธ git-time-machine
> **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.
[](https://crates.io/crates/git-time-machine)
[](https://opensource.org/licenses/MIT)
## โจ The Problem
You just:
- ๐ฅ Force pushed and lost commits
- ๐ฅ Did `git reset --hard` by 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` ๐ฏ
## ๐ Demo

*Navigate your git history like a time traveler. One key to restore.*
## ๐ฆ Installation
### Cargo (Recommended)
```bash
cargo install git-time-machine
```
### From Source
```bash
git clone https://github.com/dinakars777/git-time-machine
cd git-time-machine
cargo install --path .
```
### Homebrew (Coming Soon)
```bash
brew install git-time-machine
```
## ๐ฎ Usage
```bash
# Launch in any git repository
git-time-machine
# Show all reflog entries (default: last 50)
git-time-machine --all
```
### Controls
| `โ` / `k` | Move up |
| `โ` / `j` | Move down |
| `Enter` | Restore to selected state |
| `q` / `Esc` | Quit |
## ๐ฏ Features
- โ
**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โข
## ๐ฅ Use Cases
### Scenario 1: Accidental Reset
```bash
# Oh no! You did this:
git reset --hard HEAD~5
# No problem:
git-time-machine
# Navigate to "6m ago", press Enter
# All commits restored โจ
```
### Scenario 2: Deleted Branch
```bash
# 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
```
### Scenario 3: Bad Rebase
```bash
# Rebase went wrong
git rebase main
# Conflicts everywhere...
# Undo it:
git-time-machine
# Go back to before rebase
# Press Enter, start over
```
## ๐ ๏ธ How It Works
`git-time-machine` is a beautiful wrapper around `git reflog` that:
1. Parses your reflog history
2. Displays it in an interactive TUI
3. Lets you preview and restore any state
4. Executes `git reset --hard <hash>` when you press Enter
**It's just git under the hood** - no magic, no risk.
## ๐จ Why This Will Go Viral
1. **Solves a universal pain** - Everyone screws up git
2. **Visual + Interactive** - Makes reflog actually usable
3. **Instant gratification** - Save yourself once = hooked
4. **Beautiful demos** - TUI looks amazing in GIFs
5. **Trending tech** - Rust + TUI tools are hot right now
## ๐ค Contributing
Contributions welcome! This is a weekend project that could become something big.
**Ideas for v2:**
- [ ] Show file diffs inline
- [ ] "Panic mode" - undo last N minutes
- [ ] Branch visualization
- [ ] Stash recovery
- [ ] Search/filter commits
- [ ] Export timeline as JSON
## ๐ License
MIT ยฉ [Dinakar Sarbada](https://github.com/dinakars777)
## ๐ Star History
If this saved you once, give it a star! โญ
---