Tuesday, January 5, 2010

Revert serveral git commits

A small git trick I just learned:

To undo a single bad commit "git revert" is great.
But it is tedious to do this for many.
For that the best is:
git diff HEAD {last-good-id} | git apply

Before doing this check the logs of all commits which will be undone, with:
git log {last-good-id}..

Hope this helps someone else.

6 comments:

Baptiste said...

Completely unrelated : I've seen your post on the SGUScope project, and was pondering wether you bought the Picoscope or the Velleman ? I'm running Linux and not wanting to switch back to Win when it comes to check some stuff. I have e-mailed Kari Lane to get some news,but no answer.

Roland said...

I baught the Velleman. And I'm happy. So far I haven't got any code from Karl yet, so I haven't tried it under Linux. But it works great in Vmware.

baptiste said...

Nice !
Have you tried running the Velleman software with Wine ? I've tried it in demo mode, looks like its working, but i can't tell if it will with the scope plugged.
I also found this usb scope, which is, apart from being cheap, actually sold with an open-source software that runs on Linux, believe it or not.

Roland said...

No didn't try it in Wine.
Saw that syscomp one too. Mainly took the Velleman because I couldn't find any reviews about the syscomp.

baptiste said...

Could you try and tell me, if you can ?
Thanks !

Roland said...

Sorry. Don't want to have to install it just for that.