Viewing a Deleted File in Git

后端 未结 3 1826
盖世英雄少女心
盖世英雄少女心 2021-01-30 02:04

I\'ve deleted a file with Git and then committed, so the file is no longer in my working copy. I want to look at the contents of that file, but not actually restore it. How can

3条回答
  •  攒了一身酷
    2021-01-30 02:40

    git show HEAD^:path/to/file
    

    You can use an explicit commit identifier or HEAD~n to see older versions or if there has been more than one commit since you deleted it.

提交回复
热议问题