aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorGravatar https://www.google.com/accounts/o8/id?id=AItOawmBUR4O9mofxVbpb8JV9mEbVfIYv670uJo <Justin@web>2013-01-25 14:27:20 +0000
committerGravatar admin <admin@branchable.com>2013-01-25 14:27:20 +0000
commitb4044813edb302c87a1f660d45610061e2916fcc (patch)
tree9c6f5c0912d35392a4bfa7170d7ee19e2d17f644 /doc
parent3f569e3ec482f43d360e2e08bb46259753531d07 (diff)
fix formatting
Diffstat (limited to 'doc')
-rw-r--r--doc/forum/archaeology_of_deleted_files.mdwn12
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/forum/archaeology_of_deleted_files.mdwn b/doc/forum/archaeology_of_deleted_files.mdwn
index 5705dc119..a4ed66dc8 100644
--- a/doc/forum/archaeology_of_deleted_files.mdwn
+++ b/doc/forum/archaeology_of_deleted_files.mdwn
@@ -10,27 +10,27 @@ http://stackoverflow.com/questions/953481/restore-a-deleted-file-in-a-git-repo
Here's a magical formula you can use to find every single file deletion in the history of your repo:
-git log --diff-filter=D --summary
+ git log --diff-filter=D --summary
That will give you every commit that deleted things, and what was deleted.
To bring back all the files deleted in a given commit, where COMMITHASH is the commit hash, use this command:
-git checkout COMMITHASH^1 -- .
+ git checkout COMMITHASH^1 -- .
to bring back only a specific file:
-git checkout COMMITHASH^1 -- path/to/file.txt
+ git checkout COMMITHASH^1 -- path/to/file.txt
to bring back only a subdirectory:
-git checkout COMMITHASH^1 -- sub/directory
+ git checkout COMMITHASH^1 -- sub/directory
that will bring them back into the staging area. You can see which ones just reappeared by typing:
-git status
+ git status
then you can actually make the restore permanent by typing:
-git commit -m "I just resurrected some files"
+ git commit -m "I just resurrected some files"