git command to recover the modification
without using git add
for single revised file:
git checkout -- filename
for all the revised files:
git checkout .
with using git add
for single added file:
git reset HEAD filename
for all the added files:
git reset HEAD
with using git commit
return to the last commit state:
git reset --hard HEAD^
return to the specific commit state:
# git log: query the commit ids
git reset --hard commit_id