You could make 1 & 2, but you could simple take care about 2&3, and then make 1.
- Make a branch from master
- Re-commit (or whatever the right git term for this is) those commits into the new branch?
Assuming you have those bad commits on your master
branch in your working copy:
Simply create and switch to new branch:
git checkout -b name_of_new_branch
and then push it to repo:
git push -u origin name_of_new_branch
your colleague now should be able to do:
git fetch origin
git checkout name_of_new_branch
- Undo those commits in master
git checkout master
git reset --hard HEAD~N
where N
is number of bad commits of your colleague.
then, if you could override branches in your repo (default setting in github), then you could:
git push origin master --force
Please be very careful with this options. if I were in your shoes I will wait till someone confirm, that those commands are correct ;)