git丢弃本地更改
# Discarding local changes (permanently) to a file:
git checkout -- <file>
# Discard all local changes to all files permanently:
git reset --hard
撤消未分页的更改git
git checkout -- .
git重置一个文件
git checkout HEAD -- my-file.txt
git丢弃未分页的文件
git stash save --keep-index --include-untracked
git撤消所有更改
git reset --hard
删除本地更改git
git fetch # will fetch the latest changes on the remote
git reset --hard origin/master # will set your local branch to match the representation of the remote just pulled down.