Created
April 27, 2012 01:20
-
-
Save imeredith/2504809 to your computer and use it in GitHub Desktop.
revert changes by a specific user and cherry-pick the rest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This is what I did to revert a lot of changes I had made to a branch over a 2 week period, but still keep other commits that weren't mine. | |
| git branch old-master | |
| git reset <commitId> --hard | |
| for i in `git log master..old-master | grep -v "Author: Ivan Meredith" |grep -B 1 Author |grep commit | awk '{print $2}'`|tail -r; do git cherry-pick $i;done | |
| git push origin master --force | |
| git push origin old-master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment