git pull --rebase --autostash losing files on conflict

Viewed 28

I tried:

>git pull --rebase --autostash

which resulted in:

Created autostash: 019054d
error: Your local changes to the following files would be overwritten by checkout:
        FILENAME
Please commit your changes or stash them before you switch branches.
Aborting
fatal: Could not detach HEAD
First, rewinding head to replay your work on top of it...

I then handled the issue with FILENAME, and at this point I want to either revert to the state before trying the pull or continuing but:

C:\Projekte\FLOS>git pull --rebase --autostash
fatal: It seems that there is already a rebase-apply directory, and
I wonder if you are in the middle of another rebase.  If that is the
case, please try
        git rebase (--continue | --abort | --skip)
If that is not the case, please
        rm -fr ".git/rebase-apply"
and run me again.  I am stopping in case you still have something
valuable there.
>git rebase --abort
error: could not read '.git/rebase-apply/head-name': No such file or directory

(indeed the file does not exist, but a autostash file exists in that folder)

but the git stash list command does not show the stash created.

How do I recover all the changes which where supposed to be stashed?

1 Answers

Okay, I've got it solved. But this can't be the intended workflow.

As suggested in: How do I apply autostash after an aborted rebase?

i git stash apply 019054d (with the hash of the autostash) -> it worked even though I could not see the stash with git stash list

then I rm -fr ".git/rebase-apply" to get out of the rebase process.

Related