Undoing Git Actions

Git is a wonderful thing and despite its reputation for being really hard to use, is easy to understand and use for the usual cases. The problems occur when you make a mistake and the easy mental model you have of Git doesn’t tell you how to recover.

Over at the GitHub Blog, Joshua Wehner has an excellent post on how to recover from common Git user errors. By “error” he means some action that you wish to undo even though the action itself was legal. Even with a good mental model of how Git works, many of these recoveries are not obvious so it’s well worth your time to read through the post.

It’s valuable enough that I bookmarked it because when I do one of those things, I can never remember how to recover. For example, I learned how to start ignoring some files even though I had already started tracking them. You might think that just adding them to the .gitignore file would do the trick but it doesn’t. It’s easy to fix this problem but it certainly isn’t obvious. Take a look at Wehner’s post to find out how.

This entry was posted in General and tagged . Bookmark the permalink.