How to retrieve a single file from a specific revision in Git?

后端 未结 10 1280
臣服心动
臣服心动 2020-11-22 15:50

I have a Git repository and I\'d like to see how some files looked a few months ago. I found the revision at that date; it\'s 27cf8e84bb88e24ae4b4b3df2b77aab91a3735d8<

10条回答
  •  心在旅途
    2020-11-22 16:16

    And to nicely dump it into a file (on Windows at least) - Git Bash:

    $ echo "`git show 60d8bdfc:src/services/LocationMonitor.java`" >> LM_60d8bdfc.java
    

    The " quotes are needed so it preserves newlines.

提交回复
热议问题