Working with git: git equivalent of "svn up -r..."

Ryan Schmidt ryandesign at macports.org
Fri Nov 25 15:05:04 CET 2016


I just committed an update to the lighttpd port, but now I want to get back to the previous version.

With svn, I would have done:

cd $(port dir lighttpd)
svn up -r 151090

How do I do this with git?

I tried:

cd $(port dir lighttpd)
git checkout 72164060176afd82227b03e05aede0ce292f093f

git complained:

error: Your local changes to the following files would be overwritten by checkout:
	net/curl/Portfile
Please commit your changes or stash them before you switch branches.
Aborting

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.



More information about the macports-dev mailing list