Skip to content

Commit 1bb4405

Browse files
committed
Undoing things: Clarify what "git checkout" does to local files
The current explanation of "git checkout -- <file>" seems a bit vague, so expand on it ever so slightly. Signed-off-by: Robert P. J. Day <[email protected]>
1 parent c883d07 commit 1bb4405

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

book/02-git-basics/sections/undoing.asc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ You can see that the changes have been reverted.
130130
[IMPORTANT]
131131
=====
132132
It's important to understand that `git checkout -- <file>` is a dangerous command.
133-
Any changes you made to that file are gone -- Git just copied another file over it.
134-
Don't ever use this command unless you absolutely know that you don't want the file.
133+
Any local changes you made to that file are gone -- Git just copied the most recently-committed version of that file over top of it.
134+
Don't ever use this command unless you absolutely know that you don't want those unsaved local changes.
135135
=====
136136

137137
If you would like to keep the changes you've made to that file but still need to get it out of the way for now, we'll go over stashing and branching in <<ch03-git-branching#ch03-git-branching>>; these are generally better ways to go.

0 commit comments

Comments
 (0)