Currently the best solution that I found is
git reset --soft HEAD^2
to keep wanted changes
git reset --mixed HEAD^
to kill unwanted commit
unfortunately it will force me to recreate commits made after one that I want to disappear
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
try
git rebase -i <target commit>^Then when presented with the list of commits to rebase, delete the line for the commit you want to remove.
For example, if I have:
I can do
And will be presented with:
If you follow the instructions and remove the offending commit, then save and close the file, you will have removed that commit from your git history.