所有命令都还没有push。
由于在编辑某文件的过程中不小心做了改动,然后点了保存,还没有commit。
想要利用git恢复成尚未改动时的样子。
下面是问题描述:
我在git上创建了一个名为“428”的分支,也知道上一次提交的版本。
下面是各分支的情况
试过了下面的命令了
git checkout --
但是本地目录中的文件还是未恢复,应该怎么操作?
补充:虚拟环境目录下的文件夹也会随着git命令改动吗?
ringa_lee2017-04-17 17:57:05
To restore a single file, use git checkout [previously submitted commit id] -- file name. If you want to discard all files in the workspace, use git reset --hard <commit id>
阿神2017-04-17 17:57:05
git reset HEAD^
Revert the last commit, so that the commit is rolled back and the changes will be retained in the uncommitted state
大家讲道理2017-04-17 17:57:05
git checkout -- You need to specify the file name later.
If you want to undo all the uncommitted changes in your working directory, you can use git stash. This is to temporarily undo the changes and save them if you no longer need to restore them. , git stash drop will never recover.