Home > Net >  How to remove commits and replace them with the new commits
How to remove commits and replace them with the new commits

Time:01-20

I wanted to go back and start from a certain commit so I did a hard reset and then I committed those changes now my log looks like in the picture. So what I want to do is completely replace those 2 old commits with the new 2 commits like those old 2 commits never happened. Is there a way to do this?

How my log looks like

CodePudding user response:

Your local looks good. You have to rewrite your remote repo.

git push origin --force
  •  Tags:  
  • Related