Re: svn versus git
- From
- Peter Baumann <peter.b.baumann@stud.informatik.uni-erlangen.de>
- Date
- Dec 13, 2006, 23:32 UTC
- Message-ID
- <slrneo13co.o4k.Peter.B.Baumann@xp.machine.xx>
- In-Reply-To
- <elpun9$qp1$1@sea.gmane.org>
[...]
Show 15 quoted lines
>> svn revert:: >> Restore pristine working copy file (undo most local edits). >> git reset --hard:: >> Reset the repository to an arbitrary point in the past, updating the >> working copy as well. >> git checkout -f HEAD <file>:: >> Checks out <file> from HEAD, forcing an overwrite of any working >> directory changes to that file. >> >> Draw. There is no easy way to undo changes that have already been >> committed to a subversion repository, so git would win. However, it's >> uncomfortable to revert a single file using checkout. > > There was talk about adding "git reset [<commit-ish>] -- <file>". >
I would appreciate this. The first thing which comes to my mind if I have to actualy revert a change I made was
git reset file
After that didn't work I figured out I have to use the seperating -- and typed
git reset -- file
and that didn't work, too. After several hours (ok, I'am just exaggerating, it took me only about 15 minutes) reading manpages I figured out that I have to use git checkout [<revision>] -- file
After putting some thought into the mental model behind git checkout -- file this command it looks obvious and understantable, but in _my_ mental modell
git reset [<revision] -- file
would be a much better fit.
-Peter