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?



4 Responses to “Git is not SVN”

  1.   Carol Lerche Says:

    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.)

  2.   luke Says:

    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.

  3.   Martin Dengler Says:

    git reset HEAD does “undo” your last commit in some sense, but it’s not lost. man git-reflog.

  4.   bla Says:

    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.

Leave a Reply