Senith Umesha
Senith Umesha

Reputation: 164

How to remove commits and replace them with the new commits

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

Upvotes: 1

Views: 140

Answers (1)

daniyelp
daniyelp

Reputation: 1255

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

git push origin --force

Upvotes: 3

Related Questions