linux git discard changes in staged area code example Example: git discard staged changes git reset HEAD git checkout .