<div dir="ltr">You can unstage a change using 'git reset', e.g. 'git reset utils/haddock'.<br>As part of an interactive rebase, my approach would be to 'edit' the commit in question, then use 'git reset HEAD^' to undo that commit but keep the changes in your working directory (but unstaged), then either stage the changes you do want to keep using 'git add', or stage everything using 'git add -A' and then unstage the haddock change with 'git reset utils/haddock', followed finally by creating a new commit and continuing the rebase.<div>Hope this helps.</div><div><br></div><div><br></div><div>-Nathan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 30, 2016 at 12:21 PM, Simon Peyton Jones via ghc-devs <span dir="ltr"><<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-GB" link="blue" vlink="purple">
<div class="m_1703905140123753229WordSection1">
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">Ah yes, but it had a lot of OTHER stuff that I wanted. It was only the accidental change to a submodule that I wanted to kill off.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"><u></u> <u></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Harendra Kumar [mailto:<a href="mailto:harendra.kumar@gmail.com" target="_blank">harendra.kumar@gmail.<wbr>com</a>]
<br>
<b>Sent:</b> 30 September 2016 12:20<br>
<b>To:</b> Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>><br>
<b>Cc:</b> Edward Z. Yang <<a href="mailto:ezyang@mit.edu" target="_blank">ezyang@mit.edu</a>>; ghc-devs <<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a>><br>
<b>Subject:</b> Re: git question<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
When you do 'git rebase -i', to exclude the commit you can just delete that commit from the list of commits.<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
-harendra<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
On 30 September 2016 at 16:40, Simon Peyton Jones via ghc-devs <<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
Thanks... that worked.<br>
<br>
Somehow it ought to be possible to un-stage the haddock change rather that carefully undo it manually.  But it worked so I'm not complaining!<br>
<br>
Thank you<br>
<br>
Simon<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<br>
|  -----Original Message-----<br>
|  From: ghc-devs [mailto:<a href="mailto:ghc-devs-bounces@haskell.org" target="_blank">ghc-devs-bounces@<wbr>haskell.org</a>] On Behalf Of<br>
|  Edward Z. Yang<br>
|  Sent: 30 September 2016 11:53<br>
|  To: ghc-devs <<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a>><br>
|  Subject: Re: git question<br>
|<br>
|  Get to the commit you want to edit, then<br>
|<br>
|      cd utils/haddock<br>
|      git checkout 073d899a8f94ddec698f617a38d342<wbr>0160a7fd0b<br>
|      cd ../..<br>
|      git commit --amend -a<br>
|<br>
|  Excerpts from Simon Peyton Jones via ghc-devs's message of 2016-09-30<br>
|  10:47:24 +0000:<br>
|  > Friends<br>
|  > I have a batch of several commits lined up on my local machine,<br>
|  validated, and ready to push to the master.<br>
|  > But one seems to have accidentally got<br>
|  ><br>
|  > diff --git a/utils/haddock b/utils/haddock<br>
|  ><br>
|  > index 073d899..a3309e7 160000<br>
|  ><br>
|  > --- a/utils/haddock<br>
|  ><br>
|  > +++ b/utils/haddock<br>
|  ><br>
|  > @@ -1 +1 @@<br>
|  ><br>
|  > -Subproject commit 073d899a8f94ddec698f617a38d342<wbr>0160a7fd0b<br>
|  ><br>
|  > +Subproject commit a3309e797c42dae9bccdeb17ce52fc<wbr>ababbaff8a<br>
|  > I did not want to meddle with Haddock.<br>
|  > Question: how can I remove this change from my commit?  I know how<br>
|  to do git rebase –interactive, and I can aske to “edit” that commit…<br>
|  but what then?<br>
|  > Thanks<br>
|  > Simon<br>
|  ______________________________<wbr>_________________<br>
|  ghc-devs mailing list<br>
|  <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
|  <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.h" target="_blank">
https://na01.safelinks.<wbr>protection.outlook.com/?url=<wbr>http%3A%2F%2Fmail.h</a><br>
|  <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Faskell.org&data=01%7C01%7Csimonpj%40microsoft.com%7C9e4ee9073f99470ea33e08d3e923c3dc%7C72f988bf86f141af91ab2d7cd011db47%7C1&sdata=WOvdVzIuLQzlGaUhPDFtiTvjTApyCr6whheU2Y%2Bt7QQ%3D&reserved=0" target="_blank">
askell.org</a>%2Fcgi-bin%<wbr>2Fmailman%2Flistinfo%2Fghc-<br>
|  devs&data=01%7C01%7Csimonpj%<a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2F40microsoft.com&data=01%7C01%7Csimonpj%40microsoft.com%7C9e4ee9073f99470ea33e08d3e923c3dc%7C72f988bf86f141af91ab2d7cd011db47%7C1&sdata=e%2Bld0pVnEGodsHaanaEgkHuqbtPhMdvB4gazfbKeyVo%3D&reserved=0" target="_blank">40<wbr>microsoft.com</a>%<wbr>7C6d4ef4135a94439fb54708d3<br>
|  e91ffd21%<wbr>7C72f988bf86f141af91ab2d7cd011<wbr>db47%7C1&sdata=<wbr>rNLWdOI3SNnfXPYj<br>
|  PMHXC8U1l5sxI3eOwjHWaKpsBaY%<wbr>3D&reserved=0<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
______________________________<wbr>_________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmail.haskell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fghc-devs&data=01%7C01%7Csimonpj%40microsoft.com%7C9e4ee9073f99470ea33e08d3e923c3dc%7C72f988bf86f141af91ab2d7cd011db47%7C1&sdata=gz9aSJSVzufRNX3S3oR%2FcxboRDgWwuA3KnsRhy%2FF%2B%2Fo%3D&reserved=0" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/ghc-devs</a><u></u><u></u></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
</div></div></div>
</div>
</div>

<br>______________________________<wbr>_________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/ghc-devs</a><br>
<br></blockquote></div><br></div>