Posted By

cphoover on 08/03/12


Tagged


Versions (?)

Git Fixing un-committed mistakes


 / Published in: Other
 

  1. # MORE INFO: http://book.git-scm.com/4_undoing_in_git_-_reset,_checkout_and_revert.html
  2.  
  3. # If you've messed up the working tree, but haven't yet
  4. # committed your mistake, you can return the entire working
  5. # tree to the last committed state with
  6.  
  7. git reset --hard HEAD
  8.  
  9. #If you just want to restore just one file, say your hello.rb, use git checkout instead
  10. git checkout -- hello.rb
  11. git checkout HEAD hello.rb

Report this snippet  

You need to login to post a comment.