I have done some mess in my repo, which I don’t understand at all.
A strange commit has appeared:
commit 70cc4bd585019286ef64ef591f1b6ab310484eb3 (HEAD, origin/master,
origin/HEAD, master) Merge: 960b06a 709f964 Author: DuchSuvaa
bga.sowa@gmail.com Date: Tue Sep 12 15:46:05 2023 +0200Merge branch 'master' of https://github.com/DuchSuvaa/monitor-kolejek
I don’t really understand how that happened. Someone told me that git reset –hard HEAD~1 will do the job but when I do it, I am checkouted to the third (!) commit from the end and nothing is removed from GitHub.
How do I remove that problematic merge commit from my repo on Github?
>Solution :
git log --oneline- Copy the commit hash before merge one.
git reset --hard <copied-commit-hash>git push --force(be carefully, it rewrites the remote history)