gitã§åé¤ãã¦ãã¾ã£ããã¡ã¤ã«ã®å¾©å
gitã§åé¤ãã¦ã¯ãã¡ãªãã¡ã¤ã«ãæ¶ããäºãå¾ããçºè¦ããå ´åã
該å½ã®ãã¡ã¤ã«ã復å
ãããæ¹æ³ãã¡ã¢ã
âã®ãdel important fileãã®ã³ãããã§æ¶ããã¤ãã復å
ããããï¼
æé ï¼ï¼æ¶ããã³ãããã®ããã·ã¥ãåå¾ãã
$ git rev-list -n 1 HEAD -- important.txt 53599a4616710108d8fd035cf3c303a036a3c59c
ãHEADããªãã·ã§ã³ãå
¨ã¦ã®ã³ãããã表示ã
ã-n 1ãã§è¡¨ç¤ºããæ°ãï¼ã¤ã«çµãã
ã-- ï¼filepathï¼ãã§å¯¾è±¡ã®ãã¡ã¤ã«ãæå®ã§ããã
SourceTreeã使ã£ã¦ãã°ãè¦è¦çã«ãããããã¼ã
æé ï¼ï¼åé¤å¯¾è±¡ã®ãã¡ã¤ã«ã復å
$ git checkout 53599a4616710108d8fd035cf3c303a036a3c59c^ -- important.txt $ ls README.md etc.txt important.txt important2.txt readme.txt
復å ãããã¡ã¤ã«ã¯ã¹ãã¼ã¸ã¨ãªã¢ã«æ ¼ç´ããã¦ããã
æé ï¼ï¼å¾©å ãããã¡ã¤ã«ãå度ã³ããã
ç¡äºã«å¾©å
æåã
æã
ã¯éå»ã®éºç£ãåãæ»ããã®ã ã
åèãã¼ã¸
http://stackoverflow.com/questions/953481/restore-a-deleted-file-in-a-git-repo
Charles Baileyãããè¶ ãããã¨ãã
æ¶ãåã®ã³ãããã«æ»ã£ã¦ããã¯ã¢ãããåããå度ã³ãããããªãã
ã£ã¦ããåå§çãªæ¹æ³ããããã©ãã³ãã³ãã§ã¹ãã¼ãã«åºæ¥ãæ¹ãããããã