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!
CSS cubes really showcase what CSS has become over the years, evolving from simple color and dimension directives to a language capable of creating deep, creative visuals. Add animation and you've got something really neat. Unfortunately each CSS cube tutorial I've read is a bit...
One interesting aspect of web development is geolocation; where is your user viewing your website from? You can base your language locale on that data or show certain products in your store based on the user's location. Let's examine how you can...