0

In simplified form, I have the following git commits history:

* aaaaaaa (origin/master, origin/HEAD, master, HEAD)
* bbbbbbb
* ccccccc
*     Merge from ddddddd
|\
| * ddddddd
| * eeeeeee
| * fffffff
| |
* | ggggggg
* | hhhhhhh
* | iiiiiii
* | kkkkkkk
* | mmmmmmm
| | ooooooo
|/
* xxxxxxx
* zzzzzzz

I recently realized that there are bad commits in the master branch:

  • ddddddd
  • eeeeeee
  • ffffff

Is it possible undo changes in local repo made to the ddddddd, eeeeeee and fffffff without changing other local and remote commits?

serghei
  • 3,069
  • 2
  • 30
  • 48

1 Answers1

2

If you're working in multiple developers environment, you should just do git revert sha for each troublesome commit, then push revert commits to remote. Messing with remote master is bad when you're not the only one active developer.

dredozubov
  • 715
  • 1
  • 6
  • 11
  • Thanks I solved this with http://stackoverflow.com/questions/1895059/revert-to-a-commit-by-sha-hash – serghei Nov 14 '13 at 20:08