<div dir="ltr"><div>On Fri, Feb 21, 2014 at 8:51 PM, Walter Bright <span dir="ltr"><<a href="mailto:walter@digitalmars.com" target="_blank">walter@digitalmars.com</a>></span> wrote:<br></div><div><div class="gmail_extra">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">But I had just pulled the latest master and did a refresh on github to ensure there had been no new changes before I pushed. I'm still a bit baffled why that didn't work.<br>

<br></blockquote><div><br></div><div>When you did git reset --soft HEAD^ it picked the testCols commit, because you had merged master into that branch rather than the other way around.<br></div><div><br></div><div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
So, what's the correct procedure to undo the last commit to master?<div class="im"><br></div></blockquote><div><br></div><div>The way I usually do it is to look at the history (git log, gitk, or the internals list) to get the hash of the last correct merge commit, then `git reset --hard` to that.<br>
</div><div><br></div><div>But this can seriously screw things up if done wrong, so if you're not 110% sure it's best to just let somebody else fix it.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im">
<br>
On 2/21/2014 1:40 AM, Daniel Murphy wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
You had an old master, with your testCols commit on top.  Then you merged upstream master into it.  Then you pushed that merge commit to upstream, accidentally.<br>
<br>
When you 'fixed' it, you made the testCols commit the new master.  This discarded all the changes from the upstream master. (from the last day or so)<br>
<br>
Luckily this doesn't seem to happen very often.  To make this less likely, I recommend you do not pull from upstream master manually, and you instead have a sh/batch file that runs: `git pull upstream master --ff-only` which will fail loudly if you have made changed in your master branch (rather than silently creating a merge commit).<br>

<br>
As for CRLFs, I recommend turning git's autocrlf off, so git no longer messes with your line endings.<br>
<br>
<a href="https://github.com/D-Programming-Language/dmd/pull/3307" target="_blank">https://github.com/D-<u></u>Programming-Language/dmd/pull/<u></u>3307</a><br>
<br>
</blockquote>
<br></div><div class=""><div class="h5">
______________________________<u></u>_________________<br>
dmd-internals mailing list<br>
<a href="mailto:dmd-internals@puremagic.com" target="_blank">dmd-internals@puremagic.com</a><br>
<a href="http://lists.puremagic.com/mailman/listinfo/dmd-internals" target="_blank">http://lists.puremagic.com/<u></u>mailman/listinfo/dmd-internals</a><br>
</div></div></blockquote></div><br></div></div></div>