From e04863b55d3e59825c2384f0fba8a46ace4eaf30 Mon Sep 17 00:00:00 2001 From: Seth Woodworth Date: Tue, 23 Aug 2016 15:33:31 -0400 Subject: [PATCH] Add git-checkout example for files across branches --- pages/common/git-checkout.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pages/common/git-checkout.md b/pages/common/git-checkout.md index 52a6723d3..e0932bf79 100644 --- a/pages/common/git-checkout.md +++ b/pages/common/git-checkout.md @@ -2,14 +2,18 @@ > Checkout a branch or paths to the working tree. -- Switch to another branch: - -`git checkout {{branch_name}}` - - Create and switch to a new branch: `git checkout -b {{branch_name}}` +- Switch to an existing branch: + +`git checkout {{branch_name}}` + - Undo unstaged local modification: `git checkout .` + +- Replace a file in the current working directory with the version of it committed in a given branch: + +`git checkout {{branch_name}} -- {{file_name}}`