I had a fairly old branch and I tried to rebase it to master. I think I messed up really bad, can someone help me on how to fix it? Here is what I did:
- I used
git rebase origin/master. VSCode showed that there are 4 commits to pull, and 25k to push - I checked the status with
git status. The feature branch commits were on top of the master commits. - I pulled using
git pull, and a merge commit got created on top of all others (saw that withgit statusafterwards) - I pushed using
git push --force-with-lease
Now the GitHub PR shows all those commits and thousands of changes, and I don't know how to fix it. In my previous company we only used git merge so this entire approach is very new to me.
Thank you!
At the GitHub end, delete (close) the "bad" PR that you just made.
At your end, whip out the
reflogand find the commit before the rebase. On your branch,reset --hardto that commit.You have now undone everything described in your question.