I am maintainer of a CPAN distribution whose most recent official release is version 2.12.

Since 2.12 was published, we have made the following development releases:

2.12_001 2.12_002 2.12_003 2.12_004
In the git repository, we have tags for:
2.12_002 2.12_003 2.12_004
(Somehow 2.12_001 was overlooked or has not yet been set.)

I now realize that much of the code (mostly tests, but some source) added in 2.12_003 and 2.12_004 is conceptually flawed. For other developers and myself to treat 2.12_004 as the starting point for future development would not be fruitful.

What I would like to do is to go back to 2.12_002 and start development anew from there -- but without pretending that 2.12_003 and 2.12_004 were never released. I would like 2.12_005 to be equivalent to 2.12_002 but with only very safe, minor touchups.

Would the following be the recommended sequence of git commands?

$ git checkout master $ git checkout -b start-anew $ git reset --soft 2.12_002 $ git commit -m "Rewind to tag 2.12_002" # hack, hack, hack $ git add ... $ git commit -m "Slight touchups to what was 2.12_002" $ git checkout master $ git merge start-anew $ git tag "2.12_005"
Thank you very much.
Jim Keenan

In reply to What is best practice for 'git reset'? by jkeenan1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.