@hferentschik Last git question I promise :-( 
I'm tested your script, it works, but the push is been rejected and asking for a merge.
Do you think it would be wise that I just revert back to my commit before the unwanted merge, branch and rebase from there and up? Yes I will have to rewrite but with local backup is easy and will clean all the mess I done to repo history