As the title says, more than ten files in the workspace have been modified, but no add has been added yet. How to clear all the modifications at once
Using git checkout -- file can only restore one file at a time, please find a way to restore all files at once
滿天的星座2017-05-02 09:37:54
git checkout .
Clear all modifications without add in the current directory.
某草草2017-05-02 09:37:54
Restore the specified file in the staging area to the workspace
$ git checkout [file]
Restore the specified files of a commit to the staging area and workspace
$ git checkout [commit] [file]
Restore all files in the staging area to the workspace
$ git checkout .
Reset the specified files in the staging area , consistent with the last commit, but the workspace remains unchanged
$ git reset [file]
Reset the staging area and workspace, consistent with the last commit
$ git reset --hard
Reset the pointer of the current branch For the specified commit, reset the staging area at the same time, but the work area remains unchanged
$ git reset [commit]
Reset the HEAD of the current branch to the specified commit, and reset the staging area and work area at the same time, consistent with the specified commit
$ git reset --hard [commit]
Reset the current HEAD to the specified commit, but keep the staging area and workspace unchanged
$ git reset --keep [commit]
Create a new commit to undo the specified commit
The latter All changes will be offset by the former and applied to the current branch
$ git revert [commit]
Temporarily remove uncommitted changes and move them in later
$ git stash
$ git stash pop