<div dir="ltr">Try excluding --hard then..<div><br></div><div>git reset COMMIT</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 25, 2016 at 2:27 PM Ryan Schmidt <<a href="mailto:ryandesign@macports.org">ryandesign@macports.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg">
> On Nov 25, 2016, at 8:25 AM, rod <<a href="mailto:rod@pu-gh.com" class="gmail_msg" target="_blank">rod@pu-gh.com</a>> wrote:<br class="gmail_msg">
><br class="gmail_msg">
> Depends what you want to do when you get there really.<br class="gmail_msg">
><br class="gmail_msg">
> Disclaimer: --hard will wipe out any changes you have in your WC<br class="gmail_msg">
><br class="gmail_msg">
> This will move your current branch to point to that commit...<br class="gmail_msg">
><br class="gmail_msg">
> git reset --hard 72164060176afd82227b03e05aede0ce292f093f<br class="gmail_msg">
><br class="gmail_msg">
> But this applies to the whole git checkout, not a subtree (as i think i remember you could do with svn...)<br class="gmail_msg">
><br class="gmail_msg">
<br class="gmail_msg">
Thanks, but:<br class="gmail_msg">
"I don't want to commit or stash or do anything else to files not in the current directory."<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
> On Fri, Nov 25, 2016 at 2:06 PM Ryan Schmidt <<a href="mailto:ryandesign@macports.org" class="gmail_msg" target="_blank">ryandesign@macports.org</a>> wrote:<br class="gmail_msg">
> I just committed an update to the lighttpd port, but now I want to get back to the previous version.<br class="gmail_msg">
><br class="gmail_msg">
> With svn, I would have done:<br class="gmail_msg">
><br class="gmail_msg">
> cd $(port dir lighttpd)<br class="gmail_msg">
> svn up -r 151090<br class="gmail_msg">
><br class="gmail_msg">
> How do I do this with git?<br class="gmail_msg">
><br class="gmail_msg">
> I tried:<br class="gmail_msg">
><br class="gmail_msg">
> cd $(port dir lighttpd)<br class="gmail_msg">
> git checkout 72164060176afd82227b03e05aede0ce292f093f<br class="gmail_msg">
><br class="gmail_msg">
> git complained:<br class="gmail_msg">
><br class="gmail_msg">
> error: Your local changes to the following files would be overwritten by checkout:<br class="gmail_msg">
>         net/curl/Portfile<br class="gmail_msg">
> Please commit your changes or stash them before you switch branches.<br class="gmail_msg">
> Aborting<br class="gmail_msg">
><br class="gmail_msg">
> I don't want to commit or stash or do anything else to files not in the current directory. I only want the files in the current directory temporarily rolled back to a previous state for testing.<br class="gmail_msg">
><br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div>