Blog

Published · January 14, 2021

How to mess up with Git without breaking production

We've all pushed a commit we shouldn't have, broken everything, and panicked. Luckily, Git lets us fix those mistakes and roll back to when everything worked.

We've all pushed a commit we shouldn't have, broken everything, and panicked. Luckily, Git lets us fix those mistakes and roll back to when everything worked perfectly. Today we’re talking about CHERRY-PICK, a command that lets you pick one or more commits from a branch and apply them to another.

Alt Text

How to use git cherry-pick?

All you need is the hash of the specific commit you want to apply to your branch. How do we get that? In the terminal we run <git log>

Alt Text

And we can get back to work! It’s not one of Git’s most-used tools, but it can be very handy and save a lot of time when working across multiple branches.


Originally published on DEV Community.