git如何清除工作区所有还没有add的文件的修改?
大家讲道理
大家讲道理 2017-05-02 09:35:54
0
5
853

如题 工作区有十多个文件被修改了 但是还没有add 如何一次清除所有的修改

使用git checkout -- file 一次只能还原一个文件,求一次还原所有文件的方法

大家讲道理
大家讲道理

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

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