0

Let's assume the commit history of the branch is as follows:

John Doe [0003] Third Commit
Jane Roe [0002] Second Commit
Jane Roe [0001] First commit

What I would like to do is to completely remove the Third Commit [0003] and replace it with the new Fourth Commit (so the Fourth becomes Third).

I used git reset --hard 0002 to set the HEAD. I have also made some changes and what I want now is the NEW Second Commit (or the Fourth Commit) to become the OLD Third Commit [0003].

John Doe [0003] Fourth Commit (Second Commit with changes)

John Doe [0003] Third Commit

Jane Roe [0002] Second Commit

Jane Roe [0001] First commit

1 Answer 1

0

git push -f is what I was looking for.

Ref: Can not push changes after using git reset --hard

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.