2014年3月5日 星期三

Git 恢復

Git 恢復

復原已被更動的檔案

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   benchmarks.rb
$ git checkout -- benchmarks.rb
$ git status
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   README.txt
在上述文字可看到該變更已被復原。


沒有留言:

張貼留言