When working with Git in a TTY environment, speed and precision matter. Sometimes you need to undo changes fast — without damaging the repository or losing control. The git reset command is the tool for that. When paired with a TTY session, it gives you direct control from any local or remote terminal.
Understanding git reset in TTY
A TTY (teletype terminal) means you are operating without a GUI. Commands run at the Unix shell level. git reset changes your current HEAD, adjusting the staged snapshot and optionally your working directory. This is a direct, low-latency way to manage branches and commits when you’re SSHed into a server or working inside a container with limited resources.
The three modes of git reset
git reset --soft <commit>: Moves HEAD to the given commit. Keeps all changes staged.git reset --mixed <commit>: Moves HEAD and resets the index. Leaves changes in the working directory. This is the default.git reset --hard <commit>: Discards all changes in staging and working directory. Use with caution, especially over TTY where there’s no undo.
Why TTY use is different
TTY Git sessions tend to be minimal. No visual tools help you preview changes. Every reset must be intentional. This makes it critical to review commits before running a hard reset. Use git log --oneline and git status to verify your state.