git reset for the impatient

January 29, 2018   

A cheatsheet for what git reset does in each mode of operation.


git reset --hard <commit>

Current branch, index, and working directory set to the tree of <commit>.

git reset [--mixed] <commit>

Current branch and index set to the tree of <commit>. Working directory not modified.

git reset --soft <commit>

Current branch set to the tree of <commit>. Index and working directory not modified.