Cancel git pull --rebase?

I just ran

git pull --rebase

and forget to indicate "origin." It looks like git pulled from different branches. Is there a way to get my repo back from here to cancel the craving?

thank

+5
source share
3 answers

After the operation git pull ORIG_HEADshould indicate the previous value HEAD. You must be able to:

git reset --hard ORIG_HEAD

And go back to where you started work pull. You can run:

git show ORIG_HEAD

To see where exactly it ORIG_HEADpoints before running the command reset.

An alternative solution would be to create a new branch based on ORIG_HEAD:

git checkout -b newbranch ORIG_HEAD

Make sure everything looks as you expect, then delete the old branch and rename it new branch.

. HEAD ORIG_HEAD .

+7

git reflog

Commits HEAD, .

HEAD, ,

git checkout -b phew HEAD@{x} # fill in the number of the commit you need.
+2

Return from borked / dupid / moribund rebase

Be that as it may, I ran git pull origin master --rebaseinstead git pull origin develop --rebase.

I just wanted to get back what happened after rebase and get back to the last commit. I did not click on the remote branch.

It was a big mistake and I wanted to get out of the merger.

The fastest way out of the merger git rebase --abort

+1
source

All Articles