Reset File Changes with git
There are many different philosophies when it comes to code review but mine is fairly simple: I like receiving early "work in progress" patches, I like to be positive in my code review messages, and if a patch is 90% there, I like to finish the patch myself so the project and contributor both benefit.
Every once in while, however, a patch comes in with an unrelated file change or code added to the wrong file, in which case I need to reset a file's contents before the change commit. You can restore a file's contents before a patch with the following:
git reset origin/master path/to/file-to-be-changed.ext
Once this shell snippet is executed, the file's contents are restored and can be re-commited to restore the file contents.
![Being a Dev Dad]()
I get asked loads of questions every day but I'm always surprised that they're rarely questions about code or even tech -- many of the questions I get are more about non-dev stuff like what my office is like, what software I use, and oftentimes...
![Write Simple, Elegant and Maintainable Media Queries with Sass]()
I spent a few months experimenting with different approaches for writing simple, elegant and maintainable media queries with Sass. Each solution had something that I really liked, but I couldn't find one that covered everything I needed to do, so I ventured into creating my...
![Implement the Google AJAX Search API]()
Let's be honest...WordPress' search functionality isn't great. Let's be more honest...no search functionality is better than Google's. Luckily for us, Google provides an awesome method by which we can use their search for our own site: the Google AJAX Search API.
![jQuery topLink Plugin]()
Last week I released a snippet of code for MooTools that allowed you to fade in and out a "to the top" link on any page. Here's how to implement that functionality using jQuery.
The XHTML
A simple link.
The CSS
A little CSS for position and style.
The jQuery...
Wouldn’t
achieve the same?
Not if the change was already committed!