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

Arthur
  • 223
  • 2
  • 16

1 Answers1

0

git push -f is what I was looking for.

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

Community
  • 1
  • 1
Arthur
  • 223
  • 2
  • 16