I have two branches:
----master
|
|----lf
I developed some new feature in branch lf
and get some output. Then, I tried to switch back to master
(through git checkout
) and execute the program to compare the result. Unfortunately, git checkout master
will update what I did in lf
:
M Makefile
M src/mainloop.c
M src/threadpool.c
M src/threadpool.h
Already on 'master'
Your branch is up to date with 'origin/master'.
As a result, I get the exact same project in two branches. This is not what I want. I don't want master auto update what I changed in lf
.
My question are:
How to recover the code in
master
before I do branch (git branch lf
)?How to switch between different branches with no auto-update?