Useful Git Commands

Quick reference for obscure but helpful Git commands.

A quick list of Git commands I always end up searching for:

Undo last commit but keep changes

git reset --soft HEAD~1

Discard all local changes

git restore .
git clean -fd

See the commit history as a clean graph

git log --graph --oneline --all --decorate
GitTerminal