Cjku/git: Difference between revisions

Jump to navigation Jump to search
195 bytes added ,  28 October 2014
Line 329: Line 329:


Using it while intending to recover files in working directory form a specific revision. Index or branch ref have nothing to do with this usage.  
Using it while intending to recover files in working directory form a specific revision. Index or branch ref have nothing to do with this usage.  
   XXX: sample code need!!
   $ echo "Jerry" > a.txt
   XXX: diagram need!!
   $ git add a.txt
  $ git commit -m "initial commit"
  $ echo "is cool" >> a.txt
  $ cat a.txt
  Jerry
  is cool
  # Oops... that is definitely a typo. He is not cool at all.
  $ git reset HEAD -- a.txt
  $ cat a.txt
  Jerry


We can move forward to checkout command then:
Now, move forward to checkout command:
   $ git checkout -h
   $ git checkout -h
   usage: git checkout [options] <branch>
   usage: git checkout [options] <branch>
Confirmed users
1,643

edits

Navigation menu