还原对工作目录所做的更改

时间:2014-12-10 01:26:21

标签: git git-branch

我有以下问题。我在工作目录中创建了不必要的2个文件 我想消除它们 我尝试使用git checkout,但这没有用

fernando@fernando:~/GIT/octobox$ git status
# Not currently on any branch.
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   a.txt
#   b.txt
nothing added to commit but untracked files present (use "git add" to track)
fernando@fernando:~/GIT/octobox$ git checkout .
fernando@fernando:~/GIT/octobox$ git status
# Not currently on any branch.
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   a.txt
#   b.txt
nothing added to commit but untracked files present (use "git add" to track)

1 个答案:

答案 0 :(得分:1)

尝试git clean,也许是这样。

git clean -f