For example, in local
1st commit: 10am
2nd commit: 11am
3rd commit: 12pm
4th commit: 1pm
After the 4th commit, I found that the code is not working, so, I want to restore to 2nd commit, how to do it?
There are two cases after I restore to 2nd commit:
- I found the bugs and I think that 3rd and 4th commit is no longer working, so I would like to delete the 3rd commit and 4th commit, and then commit again for my bug fixing.
- I fixed the bugs and since the 3rd and 4th commit code is useful, I would like to have my 5th commit that is combination of my bug fixing at 2nd commit and the 4th commit.
I am new to Git, please help to solve the problem. I am using Eclipse with EGit
for my Android project.