How to cherry pick commits after they've been reverted?
Cherry-pick and rebase checks the patch id of the commit (basically a hash of the change) and already sees that the change exists on the branch, so it doesn't pick it. Rebasing can sometimes work because changes in the files may have caused the actual diff to change a bit--resulting in a different patch id--but that doesn't appear to be the case for you.
You can "revert the revert", though that will re-introduce the broken bits your co-worker introduced. Then you need to revert the buggy commits your co-worker made. It's a lot of reverting, and quite a bit to keep straight, so take it slow and have someone sit with you just to make sure you don't miss anything.
Another choice might be to replay your commits by doing git show COMMIT_ID | git apply
. This re-applies the diff to your working tree. As long as your tree is clean, you can use git commit -C COMMIT_ID
to re-use the message from the original commit. You can probably use git format-patch
and git am
to avoid the extra steps.