How to cancel git rebase-I merge

the problem scenario is as follows:
I used git rebase-I to merge multiple commit into a single commit, but now I don"t want to merge, can I go back to the state before the merge?

May.22,2021

switch to the target branch, and if the current state is newly merged into a commit, simply execute git reset-- hard HEAD~1 to fall back to the pre-merge.

or fall back to any state you want git reset-- hard commitId , where commitId is the version you want to be in hash code.

Menu