How does git clear the modifications of all files in the workspace that have not been added?
大家讲道理
大家讲道理 2017-05-02 09:35:54
0
5
874

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

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(5)
習慣沉默
git checkout head .
滿天的星座

git checkout -f

滿天的星座
git checkout .

Clear all modifications without add in the current directory.

某草草

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

刘奇

git checkout --directory name, delete changes in a certain directory

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template