Skip to content

Instantly share code, notes, and snippets.

@MIB1700
Last active April 28, 2021 09:44
Show Gist options
  • Save MIB1700/f7d24ac80b1eb4df6e0f3358344299d1 to your computer and use it in GitHub Desktop.
Save MIB1700/f7d24ac80b1eb4df6e0f3358344299d1 to your computer and use it in GitHub Desktop.

Revisions

  1. MIB1700 revised this gist Apr 28, 2021. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions GITcheckoutSpecificCommit.md
    Original 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
    ```
  2. MIB1700 created this gist Apr 28, 2021.
    7 changes: 7 additions & 0 deletions GITcheckoutSpecificCommit.md
    Original 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>
    ```