From f0b433773f373b5ac22624ad7b59cd85b5cfa6b9 Mon Sep 17 00:00:00 2001 From: KarthikSiddarth Date: Sun, 20 Oct 2019 17:08:02 +0530 Subject: [PATCH] add note about copying folder (#289) * add note about copying folder * add space b/w -- and folder name also mention, this can be done for files * add 'file' in the title --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index d9ddc59..00fe8cf 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,7 @@ All commands should work for at least git version 2.13.0. See the [git website]( - [Clone all submodules](#clone-all-submodules) - [Remove a submodule](#remove-a-submodule) - [Miscellaneous Objects](#miscellaneous-objects) + - [Copy a folder or file from one branch to another](#copy-a-folder-or-file-from-one-branch-to-another) - [Restore a deleted file](#restore-a-deleted-file) - [Delete tag](#delete-tag) - [Recover a deleted tag](#recover-a-deleted-tag) @@ -1591,6 +1592,12 @@ $ rm -rf .git/modules/submodulename ## Miscellaneous Objects +### Copy a folder or file from one branch to another + +```sh +$ (my-branch)$ git checkout -- +``` + ### Restore a deleted file First find the commit when the file last existed: