gnuherds-app-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: working with Git


From: Davi Leal
Subject: Re: working with Git
Date: Fri, 6 Mar 2009 16:02:58 +0100
User-agent: KMail/1.9.9

> [...] the below command does the work perfectly:
>
>   git revert HEAD^


IMHO, before executing the above command you should check the commit to revert 
is yet the second to last.

I will not do any other commit up to you revert that one, so it follow being 
the second one.




Q: How to revert the third to last commit using a Git command?

A: If someone else has pulled the current head:

       git revert HEAD~2


   If no one pulled yet, that is to say, if your changes are still
   private you can:

       git rebase -i HEAD~2

   then delete the last "pick" line in the editor and save.


   To see how to jump to the third last (append ^^ or ~2)
       man git-rev-parse

       * last
       * second to last
       * third to last




reply via email to

[Prev in Thread] Current Thread [Next in Thread]