Restore file from old commit in git

前端 未结 4 1822
悲哀的现实
悲哀的现实 2020-12-02 04:18

I have an old commit that I did a few weeks ago. I want to restore only a single file from that commit. What do I do?

4条回答
  •  感动是毒
    2020-12-02 05:09

    1. Check out the file from your old commit via git checkout [Revision_Key] -- path/to/file.
    2. Add, commit, push as appropriate.

提交回复
热议问题