Quanto maior o merge...

TL;DR como desculpa para escrever menos.

Desfazendo commits no git 05/08/2012

Em alguns momentos, existe necessidade de voltar alguns commits no ambiente de desenvolvimento. Para isso, uma maneira bem simples, é executar o comando git reset HEAD^.

Se precisar voltar vários commits, basta adicionar quantos ^ desejar.

Por exemplo, caso necessite desfazer meus últimos três commits, basta executar:

$ git reset HEAD^^^
blog comments powered by Disqus

                        .s$$$Ss.

            .8,         $$$. _. .              ..sS$$$$$"  ...,.;

 o.   ,@..  88        =.$"$'  '          ..sS$$$$$$$$$$$$s. _;"'

  @@@.@@@. .88.   `  ` ""l. .sS$$.._.sS$$$$$$$$$$$$S'"'

   .@@@q@@.8888o.         .s$$$$$$$$$$$$$$$$$$$$$'

     .:`@@@@33333.       .>$$$$$$$$$$$$$$$$$$$$'

     .: `@@@@333'       ..>$$$$$$$$$$$$$$$$$$$'

      :  `@@333.     `.,   s$$$$$$$$$$$$$$$$$'

      :   `@33       $$ S.s$$$$$$$$$$$$$$$$$'

      .S   `Y      ..`  ,"$' `$$$$$$$$$$$$$$

      $s  .       ..S$s,    . .`$$$$$$$$$$$$.

      $s .,      ,s ,$$$$,,sS$s.$$$$$$$$$$$$$.

      / /$$SsS.s. ..s$$$$$$$$$$$$$$$$$$$$$$$$$.

     /`.`$$$$$dN.ssS$$'`$$$$$$$$$$$$$$$$$$$$$$$.

    ///   `$$$$$$$$$'    `$$$$$$$$$$$$$$$$$$$$$$.

   ///|     `S$$S$'       `$$$$$$$$$$$$$$$$$$$$$$.

  / /                      $$$$$$$$$$$$$$$$$$$$$.

                           `$$$$$$$$$$$$$$$$$$$$$s.

                            $$$"'        .?T$$$$$$$

                           .$'        ...      ?$$#\

                           !       -=S$$$$$s

                         .!       -=s$$'  `$=-_      :

                        ,        .$$$'     `$,       .|

                       ,       .$$$'          .        ,

                      ,     ..$$$'

                          .s$$$'                 `s     .

                   .   .s$$$$'                    $s. ..$s

                  .  .s$$$$'                      `$s=s$$$

                    .$$$$'                         ,    $$s

               `   " .$$'                               $$$

               ,   s$$'                              .  $$$s

            ` .s..s$'                                .s ,$$

             .s$$$'                                   "s$$$,

          -   $$$'                                     .$$$$.

        ."  .s$$s                                     .$',',$.

        $s.s$$$$S..............   ................    $$....s$s......

         `""'           `     ```"""""""""""""""         `""   ``

                                                           [banksy]dp