From 6f9dbe9fce90b6f8efd0d6049b88a6afad1c19bc Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Mon, 15 May 2017 17:52:38 +0100 Subject: [PATCH] git-checkout: mention reset, add single-file ex. --- pages/common/git-checkout.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pages/common/git-checkout.md b/pages/common/git-checkout.md index 7d45d729b9..fff881622e 100644 --- a/pages/common/git-checkout.md +++ b/pages/common/git-checkout.md @@ -14,10 +14,14 @@ `git checkout --track {{remote_name}}/{{branch_name}}` -- Undo unstaged local modification: +- Discard all unstaged modifications in the current folder (see `git reset` for more undo-like commands): `git checkout .` -- Replace a file in the current working directory with the version of it committed in a given branch: +- Discard unstaged modifications to a given file: + +`git checkout {{file_name}}` + +- Replace a file in the current folder with the version of it committed in a given branch: `git checkout {{branch_name}} -- {{file_name}}`