2010-06-15 7 views

risposta

48

git checkout a.txt

Git ti dice questo se si digita 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 Ho controllato prima di pubblicare, e si può vedere l'output mostra diversi modi di resettare i file in diversi stati (in scena vs .stato) – abyx

+0

Ah, non sono corretto allora. Grazie per aver chiarito che :) – Daenyth

+1

@Daenyth - stai pensando a 'git checkout branch-name path' o 'git checkout HEAD path' –

15

git checkout -- a.txt

L'altra risposta in questa pagina non si ha il --, e portato a una certa confusione.

Questo è ciò che Git ti dice quando si digita 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 
# 
Problemi correlati