The pane froze mid-deploy. My fingers paused above the keyboard. Git was ahead of my local branch, Tmux was holding a dead session, and the clock was already red.
When code stacks up across commits and your terminal is split into shards, the right reset can mean the difference between clean progress and hours of chasing ghosts.
Git Reset: Clear the Slate Without Losing the Repo
Sometimes git reset --hard is the hammer. It snaps the HEAD, index, and working directory back to a commit. It kills every change local to you. For softer landings, git reset --soft moves HEAD but keeps your changes staged. git reset --mixed leaves them unstaged. The key is committing — or discarding — with intention. The earlier you decide to roll back, the cleaner the recovery.
Use git log --oneline to pick your commit hash fast. Then reset. No detached feelings, no dirty state. Your working tree is safe when you know the command before chaos hits.
Tmux Reset: Kill the Dead Weight
Inside Tmux, panes and sessions can die but still hang around. Memory leaks. Old scrollbacks. Processes clinging to sockets. Quickly cleaning them up is essential when juggling long-lived dev sessions.
tmux list-sessions shows the ghosts. tmux kill-session -t [name] frees them. For everything at once: