Git is not SVN
Turns out that there isn’t one command to revert all local changes in git, nor are the docs very helpful in that regard.
The magical alchemy you need to know is
git reset --hard HEAD
Don’t do the following, (which is what you’d think to do if you were familiar with SVN), because it’ll undo your last commit:
git reset HEAD
Now why can’t Sugar use bazaar or another sane, userfriendly VCS?
January 30th, 2009 at 14:45
Do have a recommendation for a good git tutorial for someone familiar with other version control systems? Figuring out the development infrastructure has been a huge barrier to making contributions for some people (me, e.g.)
January 30th, 2009 at 19:34
Yeah, I’d have to recommend the Git for SVN users crash course, or Everyday Git for a quick refresher.
Personally, I’m eyeing the bzr-git plugin, which allows you to use a much simpler interface to Git.
January 31st, 2009 at 18:30
git reset HEAD does “undo” your last commit in some sense, but it’s not lost. man git-reflog.
December 6th, 2009 at 12:00
Doesn’t git checkout -f HEAD do the thing? git checkout should be obvious ‘try’ after some time of using. -f required to drop changes.