博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
How can I recover a file that I deleted in my local repo from the remote repo in Git?
阅读量:4285 次
发布时间:2019-05-27

本文共 593 字,大约阅读时间需要 1 分钟。

轉載自

 

If the deletion has not been committed, the command below will restore the deleted file in the working tree.

$ git checkout -- 



You can get a list of all the deleted files in the working tree using the command below.

$ git ls-files --deleted




If the deletion has been committed, find the commit where it happened, then recover the file from this commit.

$ git rev-list -n 1 HEAD -- 

 

$ git checkout 
^ --



In case you are looking for the path of the file to recover, the following command will display a summary of all deleted files.

$ git log --diff-filter=D --summary

转载地址:http://mqsgi.baihongyu.com/

你可能感兴趣的文章
LATEX调整公式、图片与正文间距离,文字间距离,调整空白大小
查看>>
eps格式图像空白边缘裁剪
查看>>
稀疏问题的学习
查看>>
机器学习(6) MovieLens数据集
查看>>
matlab读取UCI中获取的.data文件
查看>>
matlab错误:Subscript indices must either be real positive integers or logicals.
查看>>
行列式及其性质
查看>>
matlab 保留固定长度的整数位
查看>>
xshell-常用命令
查看>>
用xshell运行matlab 远程给Linux服务器安装Matlab R2014b
查看>>
在本地电脑使用远程服务器的图形界面——包括 MATLAB、PyCharm 等各种软件
查看>>
向量转置怎么求导(多元线性回归原理推导用)
查看>>
Matlab中布尔值/逻辑值与数值型类型的相互转换
查看>>
Matlab 并行代码
查看>>
matlab中的并行方法与理解(2):parfor中的变量类型
查看>>
CentOS 7 命令行模式安装teamviewer13
查看>>
teamviewer Linux centos7安装使用详细
查看>>
【MATLAB】线条标记符大小设置
查看>>
MATLAB中矩阵的逻辑索引方法
查看>>
windows下go dep环境搭建
查看>>