【Git】误删文件&恢复文件&回滚操作
案例1比如工作区有一个文件叫test.txt文档,你需要删除,那么使用如下命令即可:git rm “test.txt”如果想撤销删除的文件,使用如下命令git reset HEAD test.txtgit checkout test.txt案例2如果你使用了git rm “test.txt” + git commit -m “remove test.txt”此时你需要回滚到之前的版本:git log找到你需要回滚的版本git checkout hash-id,这里的hash-id就
原创
2023-06-07 16:37:24 ·
2259 阅读 ·
0 评论