Git 将某个文件恢复到其他分支的状态 2025年10月14日 · Frytea · 5 分钟 · 技术笔记 git TL;DR # 下面两种写法二选一 git checkout dev -- path/to/config.yaml git restore --source=dev -- path/to/config.yaml 以上命令都做了一件事情:假设我当前在 main 分支,希望将 path/to/config.yaml 恢复到 dev 分支的状态。 返回文章列表