My operation is :
- git pull
- git checkout origin/a
- changes some code
- git add.
- git commit -m "fix: save my changes"
- git checkout b
- git checkout origin/a
and I found my changes disappeared.
My operation is :
and I found my changes disappeared.
When you checkout (using git switch
by the way) origin/a
, you are in detached head mode.
You should:
git switch a
to create a local branch a
linked to origin/a
git branch -avv
to check a exists, and has origin/a as upstreamgit reflog
to find the commit you have donegit cherry-pick <sha1>
to get that commit on your branch a