Git Undo Last Commit
I'm a massive fan of git; it's super powerful and easy to use, especially when it comes to branching. The biggest sin I commit when using git is adding files and then committing them...to master
branch instead of a feature branch. Oops. Certainly don't want that.
If you've done a git add (files)
and then commit them to the wrong branch, backing that out is easy:
git reset --soft HEAD~1
With the command above, the files are still added but not committed, so you can create your feature branch, do another git commit -m (message)
, and be on your way!
![CSS Gradients]()
With CSS border-radius, I showed you how CSS can bridge the gap between design and development by adding rounded corners to elements. CSS gradients are another step in that direction. Now that CSS gradients are supported in Internet Explorer 8+, Firefox, Safari, and Chrome...
![Vibration API]()
Many of the new APIs provided to us by browser vendors are more targeted toward the mobile user than the desktop user. One of those simple APIs the Vibration API. The Vibration API allows developers to direct the device, using JavaScript, to vibrate in...
![Dynamically Create Charts Using MooTools MilkChart and Google Analytics]()
The prospect of creating graphics charts with JavaScript is exciting. It's also the perfect use of JavaScript -- creating non-essential features with unobtrusive scripting. I've created a mix of PHP (the Analytics class), HTML, and MooTools JavaScript that will connect to Google Analytics...
![MooTools 1.2 OpenLinks Plugin]()
I often incorporate tools into my customers' websites that allow them to have some control over the content on their website. When doing so, I offer some tips to my clients to help them keep their website in good shape. One of the tips...
The other way to achieve this, is
as
HEAD^
is pointer toHEAD~1
Personally, I have an alias
git undo
which is:Git “easy to use”… Uh, what?
It’s a very complete and powerful tool, no doubt about it, but I wouldn’t call it “easy”. There’s a plethora of options and unclear docs, that it takes a lot of time just to know they exist, not to mention actually use them and get used to them.
For example, I knew about this trick, but didn’t know about Yuriy’s suggestion.
That’s why I end up using a tool like SourceTree instead.