git remove all staged changes code example Example: git discard staged changes git reset HEAD git checkout .