Is there a git command to revert all uncommitted changes in a working tree and index and to also remove newly created files and folders?
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
I think you can use the following command:
git reset --hard
Please note that there might still be files that won't seem to disappear - they might be unedited, but git might have marked them as being edited because of CRLF / LF changes. See if you've made some changes in
.gitattributes
recently.In my case I've added CRLF settings into the
.gitattributes
file and all the files remained in the "modified files" list because of this. Changing the .gitattributes settings made them disappear.Use:
For example:
If you have an uncommitted change (its only in your working copy) that you wish to revert to the copy in your latest commit, do the following:
If you want to revert the changes only in current working directory, use
And before that, you can list the files that will be reverted without actually making any action, just to check what will happen, with: