从Git还原文件? [英] Restoring a file from Git?

查看:242
本文介绍了从Git还原文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题与如何在致命文件系统错误后恢复Git?,但是对于单个文件。



我需要到最后状态2009- 07-27 23:58,我需要的文件:

  / Users / henri / BAckup / 6-relationshipdagram / Normalized_perhaps_DB / simple_schema0.tcuml 

如何在崩溃后还原文件? / p>

ADDED:我在哪里可以找到该文件?他们应该做什么?



$ p> $ git checkout 63c6844fded9cfcdee14c9330be82557046b3e56 HENRI_suunnittelu_doc / 6-relaatiotietokantakaavio / Normalized_perhaps_DB / simple_schema0.tcuml

威廉的提示



  git checkout bee6763b55cf8259438aa575cedbb09d1d02b96a HENRI_suunnittelu_doc / 6-relaatiotietokantakaavio / Normalized_perhaps_DB / simple_schema0.tcuml 


解决方案

有时候我删除了一个文件或目录在我的git local我想恢复只是那个文件。我运行以下命令:

  git checkout  -  filenameOrDirectory 

请注意两者之间的空格。


The question is related to the question "How to restore Git after fatal file system error?", but for a single file.

I need to get to last state 2009-07-27 23:58, where I need the file:

/Users/henri/BAckup/6-relationdiagram/Normalized_perhaps_DB/simple_schema0.tcuml

How can I restore the file after a crash?

ADDED: Where will I find the file? What are they supposed to do?

Graham's tip

$git checkout 63c6844fded9cfcdee14c9330be82557046b3e56 HENRI_suunnittelu_doc/6-relaatiotietokantakaavio/Normalized_perhaps_DB/simple_schema0.tcuml

William's tip

git checkout bee6763b55cf8259438aa575cedbb09d1d02b96a  HENRI_suunnittelu_doc/6-relaatiotietokantakaavio/Normalized_perhaps_DB/simple_schema0.tcuml

解决方案

sometimes i delete a file or directory in my git local and i want to restore just that file. i run the following command:

 git checkout -- filenameOrDirectory

note the spaces in between.

这篇关于从Git还原文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆