Last active
April 28, 2021 09:44
-
-
Save MIB1700/f7d24ac80b1eb4df6e0f3358344299d1 to your computer and use it in GitHub Desktop.
Revisions
-
MIB1700 revised this gist
Apr 28, 2021 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,4 +4,10 @@ When we need to retrieve a single file from an old commit, because the current o ```bash git checkout <COMMIT#> <path/to/the/messed/up/file> ``` To get the **COMMIT#**: ```bash git log ``` -
MIB1700 created this gist
Apr 28, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ #Git: checkout a single file from a specific commit When we need to retrieve a single file from an old commit, because the current one got deleted or broken and then commited by mistake, use: ```bash git checkout <COMMIT#> <path/to/the/messed/up/file> ```