Reset a Branch to Remote State with git
Every once in a while I accidentally hose my repository's master branch by merging or committing something I shouldn't. And then on rare occasion I push that to my remote and then things get all sorts of messed up. Every PR from that point on has some wonky commits and I look like a noob. Sometimes the best course of action is to just reset to the a remote branch's master (i.e. the repository I forked the project from) and get on with life that way. Here's how to do so:
git fetch some-remote # "origin" if you want to use your own branch
git reset --hard some-remote/master
The first step is fetching a list of branches from the remote. The next is executing a hard reset of the branch based on the remote.
Now you can stop asking yourself how things got so messed and up can get back to business!
![Convert XML to JSON with JavaScript]()
If you follow me on Twitter, you know that I've been working on a super top secret mobile application using Appcelerator Titanium. The experience has been great: using JavaScript to create easy to write, easy to test, native mobile apps has been fun. My...
![Animated 3D Flipping Menu with CSS]()
CSS animations aren't just for basic fades or sliding elements anymore -- CSS animations are capable of much more. I've showed you how you can create an exploding logo (applied with JavaScript, but all animation is CSS), an animated Photo Stack, a sweet...
![:valid, :invalid, and :required CSS Pseudo Classes]()
Let's be honest, form validation with JavaScript can be a real bitch. On a real basic level, however, it's not that bad. HTML5 has jumped in to some extent, providing a few attributes to allow us to mark fields as required or only valid if matching...
![Create a CSS Flipping Animation]()
CSS animations are a lot of fun; the beauty of them is that through many simple properties, you can create anything from an elegant fade in to a WTF-Pixar-would-be-proud effect. One CSS effect somewhere in between is the CSS flip effect, whereby there's...