LWN.net Logo

Git Magic

Git Magic

Posted Aug 6, 2008 3:37 UTC (Wed) by newren (subscriber, #5160)
In reply to: Git Magic by yarikoptic
Parent article: Git Magic

Why not just use the reflog to recover?  For example:

$ git reflog show HEAD

You can use a branch name, such as 'master', in the place of 'HEAD' too.  That will show the
different sha1's that the branch (or HEAD) has stored over time with information about what
caused the change (a commit, a merge, a reset, a checkout, a rebase, etc.)  You can also use
the named versions to obtain an old revision, e.g.

$ git reset --hard HEAD@{12} 


(Log in to post comments)

Git Magic

Posted Aug 6, 2008 3:58 UTC (Wed) by yarikoptic (subscriber, #36795) [Link]

learn new things every day! Now I will use it. not sure if for critical changes I would
abandon full-backup but now I would feel safer - Linus watched my back ;)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds