If I commit many changes, then I realize one of these commits is not correct. How could I remove just that commit. For example, below is the git log (with some arguments to make it easy to check), I commit 3 changes, and I want to remove the change from test2, also I want to remove the commit record from git log as well. How could I do that?
* 28b3c19 2014-10-21 | test3 [Xinyu Hou]
* 73ca35d 2014-10-21 | test2 [Xinyu Hou]
* 2785334 2014-10-21 | test1 [Xinyu Hou]
* 9729226 2014-10-21 | cleaned up .gitignore
I hope the result could be something like below
* 28b3c19 2014-10-21 | test3 [Xinyu Hou]
* 2785334 2014-10-21 | test1 [Xinyu Hou]
* 9729226 2014-10-21 | cleaned up .gitignore
I tried git revert, apart from the conflict, it doesn't seem to remove the commit record in log.
Thanks, Jerry