From 152fc23c6b1c0f917778f8f8f768c8abd9a2a408 Mon Sep 17 00:00:00 2001 From: Warren Toomey Date: Wed, 2 Mar 2016 18:42:43 +1000 Subject: [PATCH] Added some notes about recovering deleted git files. --- misc/git_notes.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc/git_notes.txt b/misc/git_notes.txt index 8a547c2..98ba61d 100644 --- a/misc/git_notes.txt +++ b/misc/git_notes.txt @@ -4,7 +4,10 @@ to cache my Github username git config --global user.name "Warren Toomey" git config --global user.email wkt@tuhs.org -To bring your own ocal repository up to date with Github: +To bring your own local repository up to date with Github: git fetch origin git diff master origin/master git merge origin/master + +To recover a delete file $file: + git checkout $(git rev-list -n 1 HEAD -- "$file")^ -- "$file"