鍍金池/ 教程/ Java/ 第23關 checkout_file
第13關 stash
第37關 push_branch
附錄A Git 學習資源
第54關 submodule
第15關 restructure
第18關 push_tags
第17關 tag
前言
第22關 reset_soft
Githug 安裝和使用方法
第41關 repack
第16關 log
第7關 ignore
第10關 number_of_files_committed
第29關 diff
第1關 init
第4關 commit
第33關 checkout_tag
第20關 commit_in_future
第14關 rename
第39關 fetch
第9關 status
第11關 rm
第27關 remote_add
第3關 add
第24關 remote
第26關 pull
第44關 rename_commit
第23關 checkout_file
第32關 checkout
第55關 contribute
第47關 reorder
關卡列表
第35關 branch_at
第5關 clone
第45關 squash
第43關 grep
第36關 delete_branch
第53關 conflict
第34關 checkout_tag_over_branch
第42關 cherry-pick
第19關 commit_amend
Githug 通關攻略
附錄C Vim 常用命令
第48關 bisect
第46關 merge_squash
第2關 config
附錄B Linux 常用命令
第21關 reset
第50關 find_old_branch
第12關 rm_cached
第8關 include
第31關 branch
第49關 stage_lines
第30關 blame
第52關 restore
第51關 revert
第28關 push
第25關 remote_url
第40關 rebase
第38關 merge
第6關 clone_to_folder

第23關 checkout_file

A file has been modified, but you don't want to keep the modification. Checkout the 'config.rb' file from the last commit.

一個文件已被修改過,但你不想保留修改過的內容。從最后一次提交中 checkout 出 'config.rb' 文件。

這還是一個撤銷操作。如果你想放棄工作目錄中已經(jīng)修改過的內容,就用這個命令:

$ git checkout your-file

Git 會用最后一次提交的文件覆蓋掉工作目錄中的同名文件。但做這個操作一定要謹慎,因為這個操作是不可以被撤銷的,執(zhí)行之后你修改過的內容就找不回來了。

第23關過關畫面如下:

http://wiki.jikexueyuan.com/project/githug-walkthrough/images/level-23-checkout-file.png" alt="第23關 checkout_file" />

上一篇:第14關 rename下一篇:第2關 config