On Wed, Sep 15, 2010 at 09:54:24PM +0900, David Cournapeau wrote: > The basic way to use reflog is trivial: it just keeps a (time ordered) > list of your commits and actions, independently of the branch. So for > example, say you are in master, and by accident, you do:
> git reset --hard origin/master # origin/master is behind master > git reflog > will look like: > b59aa8c h...@{0}: origin/master: updating HEAD > ad5c0c0 h...@{1}: pull github master: Fast forward > d11b913 h...@{2}: commit: ENH: add builder override support for > compiled libraries. > 2423a03 h...@{3}: commit: FEAT: add get_compiled_libraries to get all > clib from all subpackages. > ae4c57b h...@{4}: merge tmp: Fast forward > f4c4b53 h...@{5}: github/master: updating HEAD > ae4c57b h...@{6}: checkout: moving from tmp to master > ae4c57b h...@{7}: checkout: moving from > ae4c57bab5583759aab831eafce0c9b83a5f9c45 to tmp > ... I don't understand which line corresponds to the 'reset --hard' in the above reflog (sorry, I am slow). Is it the 'updating HEAD' one? Reading the above, it seemed to me that I could always revert my previous action (unless it impacted non-tracked files) using: git checkout h...@{0} I just tried it on a copy of a repo I had, and I get "You are in a 'detached HEAD'". From what I understand from the message (and Google) I simply need to do a "git checkout -b new_branch" to be in a state where I can work. However, it seem to me that when I switch back the the master branch, and merge my new_branch, I haven't "undone" the action I was trying to undo. Sorry for asking these questions, but I'd rather be dense and ask them while I am playing with a toy repo than suffer from my git inability later on a real situation, which usually happens at 2AM. Thanks for you git-foo Gaël _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion