chenzhihao-mac:gitlearning chenzhihao$ cat readme.md Hello world! Git is a very important Code Management System! chenzhihao-mac:gitlearning chenzhihao$ vi readme.md chenzhihao-mac:gitlearning chenzhihao$ cat readme.md Hello world! Git is a very important Code Management System! Test testtesttest chenzhihao-mac:gitlearning chenzhihao$ git status On branch master 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: readme.md no changes added to commit (use "git add" and/or "git commit -a") chenzhihao-mac:gitlearning chenzhihao$ git checkout -- readme.md chenzhihao-mac:gitlearning chenzhihao$ git status On branch master nothing to commit, working tree clean chenzhihao-mac:gitlearning chenzhihao$ cat readme.md Hello world! Git is a very important Code Management System!
chenzhihao-mac:gitlearning chenzhihao$ vi readme.md chenzhihao-mac:gitlearning chenzhihao$ cat readme.md Hello world! Git is a very important Code Management System! Test chenzhihao-mac:gitlearning chenzhihao$ git add readme.md chenzhihao-mac:gitlearning chenzhihao$ git status On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) modified: readme.md chenzhihao-mac:gitlearning chenzhihao$ git reset head readme.md Unstaged changes after reset: M readme.md chenzhihao-mac:gitlearning chenzhihao$ git status On branch master 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: readme.md no changes added to commit (use "git add" and/or "git commit -a") chenzhihao-mac:gitlearning chenzhihao$ cat readme.md Hello world! Git is a very important Code Management System! Test chenzhihao-mac:gitlearning chenzhihao$ git checkout -- readme.md chenzhihao-mac:gitlearning chenzhihao$ cat readme.md Hello world! Git is a very important Code Management System! chenzhihao-mac:gitlearning chenzhihao$ git status On branch master nothing to commit, working tree clean