Changes between Version 10 and Version 11 of versionControl/git


Ignore:
Timestamp:
Jul 12, 2016 12:02:03 PM (6 years ago)
Author:
juaco
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • versionControl/git

    v10 v11  
    296296
    297297
    298 {{{git reset}}} as the dangerous method. When you undo with {{{git reset}}}(and the commits are no longer referenced by any ref or the reflog), there is no way to retrieve the original copy—it is a permanent undo.
     298{{{git reset}}} is a dangerous method. When you undo with {{{git reset}}} (and the commits are no longer referenced by any ref or the reflog), there is no way to retrieve the original copy—it is a permanent undo.
    299299
    300300Remove the specified file from the staging area, but leave the working directory unchanged. This unstages a file without overwriting any changes.
     
    429429
    430430
     431==== Getting back to the latest commit
     432
     433If you know the commit you want to return to is the head of some branch (the default is usually the `master` branch), or is tagged, then you can just
     434
     435{{{
     436git checkout <branchname>
     437}}}
     438
     439Another useful command is `git reflog`, to see what other commits your `HEAD` (or any other ref) has pointed to in the past.
     440
     441{{{
     442git reflog
     443}}}
     444
     445This is different than `git log` because it lists the hole history, and not just the strictly the antecedent events.
     446
     447
    431448== Git Branches ==
    432449