Undo File Changes with Git
One of my favorite features in modern text editors is their ability to integrate tools to format code upon every save. When you're working on legacy projects, however, auto-formatting can be a problem; if you open a file that you don't explicitly change, the file may still get modified by the formatter. This all leads to
git status showing a bunch of file modifications that you don't want.
To quickly undo file changes with git, execute the following two commands:
git reset HEAD path/to/file.ext
git checkout path/to/file.ext
The second command (
checkout) is required or you'll still see the file listed when running
git status again. With both of those executions, you'll no longer see the file listed with
git makes version control easy but the two steps needed to essentially revert changes to a file aren't intuitive, thus I thought I would share on this blog. Happy coding!
You've probably heard the talk around the water cooler about how promises are the future. All of the cool kids are using them, but you don't see what makes them so special. Can't you just use a callback? What's the big deal? In this article, we'll...
Last year I wrote a popular post titled AJAX For Evil: Spyjax when I described a technique called "Spyjax":