Using only the basic git commands:
This answer is a bit longer than Charles, but it consists only of the basic git commands that I can understand and thus remember, eliminating the need to continue searching.
Mark your current location (fix first):
git checkout -b temp
Reset (moves) the marker to another branch without changing the working directory:
git reset <branch where you want to go>
now temp and the other branch point to the same commit, and your working directory is not touched.
git checkout <branch where you want to go>
since your HEAD already points to the same commit, the working directory is not affected
git branch -d temp
Please note that these commands are also available to any graphical client.
nus Jul 01 2018-12-12T00: 00Z
source share