R
R
Roman Pervuhin2022-02-23 10:04:27
git
Roman Pervuhin, 2022-02-23 10:04:27

Merged the master branch with the develop branch, how to undo the merge?

I worked in the develop branch, reached a certain state of the project, created a pull request through the github site and poured the changes into master, created the v0.1.0 tag. After that, I edited the README.md file in the master branch, wanted to get the changes of this file in the develop branch and poured "Merge branch 'master' into develop". After that, the representation of branches, for example, in GitKraken became incomprehensible.
Before: forHabr.jpg?raw=true
After: 6215db7ecff35160906538.png

Some actions were taken after the merger, but they can be torn down if necessary. They are saved separately.
Repository Link: Repository

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Pervuhin, 2022-02-23
@Klim5198

You need to do:
git checkout master
git reset --hard
git push
-f undo the last commit before the merge

T
toxa82, 2022-02-23
@toxa82

git revert -m1 <merge_commit_hash>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question