I was designing my application and at some point realized, that what I am doing is a separate branch. I was committing my changes into local repository into "master", but not into remote repository.
In my VCS log in IntelliJ I see the following picture:
I.e. I have two separates paths of development with me and remote.
This sounds like you want to shift your current working branch into a new branch called
AsyncIntegrate and then reset your local
Create the feature branch:
git checkout master git checkout -b AsyncIntegrate
Reset your local master to origin/master:
git fetch git checkout master git reset --hard origin/master
git fetch step above is important and should not be ignored, because it will update your local tracking branch
origin/master with the current state of affairs of the actual remote
master branch. If for some reason you want to use the (possibly stale)
origin/master, then you can omit this step.
Take a deep breath and relax, because there is little chance for something catastrophic to happen here. All the work you (perhaps incorrectly) did on the local
master branch should now be safe in a new local branch called
AsyncIntegrate. And your local
master would simply be in sync with the state of the remote, which is usually where you want to be.
And even if you were to loose the previous commit you were working on, you could always recover it from the Reflog. Resetting branches is succinctly mentioned in the documentation