Hi,<br><br>I agree. You can&#39;t remove the commits from the log without risking to corrupt it for other people. If you would know that no one has pulled you could do rewrite the history (using rebase/reset with forced push) to remove it from the log. <br>
But since you don&#39;t, you need to generate a new commit which undoes the wrong commits. For a single(/a few) you can use git-revert.<br><br>In this case the easiest was:<br>git log 9bc2b6815a4253eb4c25070f3e830e..<br>to see that I got the correct id (I took it from the commit email)<br>
and then:<br>git diff HEAD 9bc2b6815a4253eb4c25070f3e830e | git apply<br>to generate the undo commit.<br><br>Michael, please check that I did it correct and didn&#39;t undo too much. Just look at the git log output (or my commit message) and check that I didn&#39;t revert any commit which was not supposed to be undo. I did check that I didn&#39;t revert anything from anyone but Michael, so all commits by everyone should be fine.<br>
<br>Roland<br><br>
<br><div class="gmail_quote">On Mon, Jan 4, 2010 at 8:23 PM, Mark Abraham <span dir="ltr">&lt;<a href="mailto:Mark.Abraham@anu.edu.au" target="_blank">Mark.Abraham@anu.edu.au</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div>Michael Shirts wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all-<br>
<br>
I accidentally ran a &quot;git push origin&quot; to the public repository<br>
instead of a &quot;git push gromacs_mrs&quot; (my &#39;private&#39; public repository),<br>
and after a couple of hours of googling, am still not sufficiently<br>
certain I know to revert a push to a public repository without messing<br>
everyone up that I&#39;m willing to try it.  The European developers seem<br>
to have gone to bed, so if anyone else feels confident in their<br>
knowledge of git, please let me know!  Or alternately, you might want<br>
to avoid pulling any changes tonight.  Apologies for the<br>
inconvenience!<br>
</blockquote>
<br></div>
You probably can&#39;t do anything. One can change pretty much anything before any other repo has pulled from the one to which you committed erroneously. However once anybody has pulled, your &quot;undo&quot; changes risk trashing their repository.<br>


<br>
&quot;git revert&quot; is used in this case to record a new commit to undo cleanly the effect of the erroneous one. You can experiment with its usage by pushing the error to gromacs_mrs, reverting on your working repo, and pushing again to gromacs_mrs.<br>


<br>
One workflow that helps avoid this is to have gromacs_mrs a clone of the official repo, and you clone gromacs_mrs to your working repo. origin points to the clone origin, not the ancestor. Now all you need to do is take care you know which repo you&#39;re in when you &quot;git push origin&quot; (not too hard!). Alternatively, you can edit .git/config to change the label of origin wrt gromacs_mrs to something that you won&#39;t type unthinkingly - like &quot;gromacscentralmaster&quot; etc.<br>

<font color="#888888">
<br>
Mark</font><div><div></div><div><br>
-- <br>
gmx-developers mailing list<br>
<a href="mailto:gmx-developers@gromacs.org" target="_blank">gmx-developers@gromacs.org</a><br>
<a href="http://lists.gromacs.org/mailman/listinfo/gmx-developers" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-developers</a><br>
Please don&#39;t post (un)subscribe requests to the list. Use the www interface or send it to <a href="mailto:gmx-developers-request@gromacs.org" target="_blank">gmx-developers-request@gromacs.org</a>.<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>ORNL/UT Center for Molecular Biophysics <a href="http://cmb.ornl.gov" target="_blank">cmb.ornl.gov</a><br>865-241-1537, ORNL PO BOX 2008 MS6309<br>