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" />