The terminal cursor blinked. One command could wipe hours of work or fix the mess in seconds.
git reset is the scalpel of Git. It can cut deep. With the wrong flags, it rewrites history. With the right ones, it restores control. Understanding how git reset works is critical when managing branches, commits, and staging areas.
There are three main forms:
git reset --softmoves the HEAD pointer but leaves changes staged.git reset --mixed(default) moves HEAD and clears the index, leaving files modified but unstaged.git reset --hardmoves HEAD and resets both index and working tree, discarding all changes.
Before running git reset, inspect your commit log with git log --oneline and confirm commit hashes. In complex workflows, keep backups or work on disposable branches to avoid unrecoverable loss.
Socat is a command-line utility that creates bidirectional data channels. It’s often used for port forwarding, tunneling, or linking sockets. In debugging Git hooks or custom server-side Git actions, socat can bridge local processes with network endpoints, making it possible to test hooks, proxies, or authentication flows without pushing to a live remote.