<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 20, 2016 at 10:39 PM, Tim Felgentreff <span dir="ltr">&lt;<a href="mailto:timfelgentreff@gmail.com" target="_blank">timfelgentreff@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><p dir="ltr">Hi Eliot, </p>
<p dir="ltr">When I did the migration I made a gitrevert script. It is in the scripts dir.</p></blockquote><div><br></div><div>Thanks Tim.  Just an FYI for Mac users, the script presumes an up-to-date git, but Mac OS X yosemite only ships with 2.4.9.  The upgrade is easy; I&#39;m currently using 2.10.0.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr"> </p>
<p dir="ltr">Best, <br>
Tim </p>
<div class="gmail_quote">Am 20.06.2016 23:12 schrieb &quot;Damien Pollet&quot; &lt;<a href="mailto:damien.pollet@gmail.com" target="_blank">damien.pollet@gmail.com</a>&gt;:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr">To complete Tobias&#39;s answer, git checkout HEAD -- &lt;files&gt; will restore files from the most recent commit even if changes were staged.<br><div><br></div>In what situation do you use that script?<div><br></div><div><div>People on stack overflow seem to have pretty polarized opinions about fiddling with timestamps… one of the answers has something close, but there might be a simpler way…</div><div><a href="http://stackoverflow.com/questions/1964470/whats-the-equivalent-of-use-commit-times-for-git" target="_blank">http://stackoverflow.com/<wbr>questions/1964470/whats-the-<wbr>equivalent-of-use-commit-<wbr>times-for-git</a><br></div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 20 June 2016 at 22:40, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr"><div>Hi git mavens,</div><div><br></div><div>    I&#39;ve used a script called svnrevert in the svn version that reverts any changed file in its argument(s), which may be directories, /and/ sets the modification date to the date at which the file was last checked in. I&#39;d like the same functionality in git.  Her&#39;es the subversion version:</div><div><br></div><div><div>#!/bin/bash</div><div># Revert file(s) or all modified files in a directory</div><div># and touch them back to the checkin date</div><div>for f in &quot;$@&quot;</div><div>do</div><div><span style="white-space:pre-wrap">        </span>if [ -d &quot;$f&quot; ]; then</div><div><span style="white-space:pre-wrap">                </span>$0 `svn st &quot;$f&quot; | grep &quot;^M&quot; | sed &#39;s/^M *//&#39;`</div><div><span style="white-space:pre-wrap">        </span>else</div><div><span style="white-space:pre-wrap">                </span>if svn revert &quot;$f&quot;; then</div><div><span style="white-space:pre-wrap">                        </span>changed=&quot;`svn info \&quot;$f\&quot; | grep &#39;Last Changed Date:&#39; | sed &#39;s/ *(.*//&#39;`&quot;</div><div><span style="white-space:pre-wrap">                        </span>touch -t &quot;`date -j -f &#39;Last Changed Date: %Y-%m-%d %H:%M:%S %z&#39; \&quot;$changed\&quot; &#39;+%Y%m%d%H%M.%S&#39;`&quot; &quot;$f&quot;</div><div><span style="white-space:pre-wrap">                </span>fi</div><div><span style="white-space:pre-wrap">        </span>fi</div><div>done</div></div><div><br></div><div data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div data-smartmail="gmail_signature">Damien Pollet<br>type less, do more [ | ] <a href="http://people.untyped.org/damien.pollet" target="_blank">http://people.untyped.org/<wbr>damien.pollet</a><br></div>
</div>
<br></blockquote></div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>