2010-06-15 10 views

Odpowiedz

48

git checkout a.txt

Git mówi, to po wpisaniu git status:

# On branch master 
# Changes to be committed: 
# (use "git reset HEAD <file>..." to unstage) 
# 
# modified: a 
# 
# Changed but not updated: 
# (use "git add <file>..." to update what will be committed) 
# (use "git checkout -- <file>..." to discard changes in working directory) 
# 
# modified: a 
# 
+3

@Daenyth Sprawdziłem go przed wysłaniem, a można zobaczyć wyjście pokazuje różne sposoby kasowania plików w różnych stanach (wystawił vs niepotwierdzony) – abyx

+0

Ah, jestem wtedy niepoprawny. Dzięki za wyjaśnienie, że :) – Daenyth

+1

@Denekt - myślisz o 'git checkout nazwa-gałęzi ścieżka' lub 'git checkout HEAD ścieżka' –

15

git checkout -- a.txt

Druga odpowiedź na tej stronie nie mają -- i spowodowało pewne zamieszanie.

To jest to, co mówi, Git po wpisaniu git status:

# On branch master 
# Changes to be committed: 
# (use "git reset HEAD <file>..." to unstage) 
# 
# modified: a 
# 
# Changed but not updated: 
# (use "git add <file>..." to update what will be committed) 
# (use "git checkout -- <file>..." to discard changes in working directory) 
# 
# modified: a 
# 
Powiązane problemy