A coworker accidentally merged dev into master and pushed. A few more commits were pushed before I noticed.
I pulled master in my local env
git pull origin master
I created a new branch to do some tests revert
git checkout -b prod
I reverted to the commit before the bad merge
git reset --hard <commitId> && git clean -f
The code is now good but the problem is when I try to merge in the new prod an old branch that has already been merged in dev. I get the message :
Already up-to-date.
Is there a way to fix this or we will have to copy the code from the old branchs into prod
reset
command next, which in Git is different fromrevert
. In English "revert" can mean "go back to where you were before", but in Git, "revert" means to make a new commit which does the exact opposite of the reverted commit, such that the sum total of the two commits is no changes. Sorevert
andreset
do very different things, in Git. – TTTprod
branch, already was inmaster
beforedev
got merged in. (Either that, or you didn't do exactly what you think you did.) Maybe you could try a "newer" branch that definitely isn't inmaster
yet. – TTT