Git Delete Commit

To keep myself from looking when it happens again, here’s a personal reference of how to delete a commit:

If you made a commit, but have not pushed it to others:

git reset HEAD^

OR

git reset HEAD~1

both HEAD^ and HEAD~1 are shortcuts for the commit before head.

The above command will make sure you don’t lose your changes – instead, the commit will be deleted and your files will state they are locally modified. It’s the same thing as doing git reset –soft HEAD^

To delete your commit as well as ALL local changes including any staged, uncommitted, changes (remember, only if you haven’t pushed it to others):


git reset --hard HEAD^

If you already pushed your commit, you need to create a new commit that reverses your mistake.


git revert HEAD

Going green with electronics

Solar-Powered USB Charger

A few months ago I built a solar powered iPhone charger for a friend’s birthday – it turned out great!

The solar panel is 110mm x 140mm. It outputs 6V at 330 mA and charges a lithium ion polymer battery with a capacity of 1200mAh (total of about 4.5 Wh) and a nominal output of 3.7V.

Solar-Powered USB Charger Solar-Powered USB Charger

Christmas Post

Being the 24th of December, I thought it would be the perfect chance to give myself a gift – a new blog!

I’ve been planning it for awhile, I just hadn’t had the time until now (or so I keep telling myself…).

This blog will mainly serve the purpose of storing information I don’t want to forget, solutions to coding problems I’ve had and resolved, or just my general insane ramblings from time to time (though I do try to keep those on the down-low and off the internet).

Well, I hope you find the posts on my blog informative or interesting to read and I hope that you find whatever it was you were looking for when you landed here :-)

Merry Christmas and Happy New Year…or whatever season it is when you’re reading this ;-)