undo git stash with conflicts 1

undo git stash with conflicts

git reset HEAD . (note the trailing dot)
git stash (save the conflicted merge, just in case)
git checkout develop
git fetch upstream; git merge upstream/develop
git checkout ; git rebase develop
git stash apply stash@{1}

Here is what the above code is Doing:
1. git reset HEAD .
This will unstage all the files that were staged for commit.
2. git stash
This will save the conflicted merge, just in case.
3. git checkout develop
This will switch to the develop branch.
4. git fetch upstream; git merge upstream/develop
This will update the develop branch with the latest changes from the upstream repository.
5. git checkout ; git rebase develop
This will switch to the new branch and rebase it with the updated develop branch.
6. git stash apply stash@{1}
This will apply the conflicted merge that was saved in step 2.

Similar Posts