Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From the root directory of your working copy just do</p> <pre><code>git checkout A2 -- . git commit -m 'going back to A2' </code></pre> <hr> <p>Using <a href="http://www.kernel.org/pub/software/scm/git/docs/git-revert.html" rel="noreferrer"><code>git revert</code></a> for this purpose would be cumbersome, since you want to get rid of a whole series of commits and <code>revert</code> undoes them one at a time.</p> <p>You do not want <a href="http://www.kernel.org/pub/software/scm/git/docs/git-revert.html" rel="noreferrer"><code>git reset</code></a> either. That will merely change your <code>master</code> branch pointer: you are left with no record of the mistaken direction. It is also a pain to coordinate: since the commit you changed <code>master</code> to is not a child of the remote repository’s <code>master</code> branch pointer, pushing will fail – unless you add <code>-f</code> (force) or delete the <code>master</code> branch in the remote repository first and recreate it by pushing. But then everyone who tries to pull will still have the old history in their local <code>master</code> branch, so once <code>origin/master</code> diverges, <code>git pull</code> will try to perform a merge. This is not the end of the world: they can get out of this situation by doing <code>git rebase --onto origin/master $old_origin_master_commit master</code> (ie. rebase their local commits made on top of the old <code>origin/master</code> onto the top of the new <code>origin/master</code>). But Git will not know to do this automatically so you have to coordinate with every collaborator. In short, don’t do that.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload