I Had to -
I Did -
I don't care if my code loses, I just Want to Re-do This Process without any branch conflicts
Perform these steps
git log // then copy the commit id at which the state of your branch is
correct
.git reset --hard commitId
git push -f
In case you don't want to lose the code:
git log // then copy the commit id at which the state of your branch is
correct
.git reset --soft commitId
git reset.
- git stash //saving the work
- git reset --hard //Erase everything
- git push -f
Now clone the correct repository and apply: git stash pop
//this will bring in the changes on the intended repository
solve if there are any merge conflicts.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.