Suppose I have the following git commits:
aaaaaa
bbbbbb
cccccc
(the latest)I would like to go back to bbbbbb
and continue the development from there. Essentially, I want to remove cccccc
for now and be able to retrieve it in the future (I know I'd still need the cccccc
). Should I revert cccccc
or rollback to bbbbbb
?
Just do:
git checkout -b dev_on_b bbbbbbb
which will leave the branch with cccccc alone and give you a new branch starting from bbbbbb. When you want to return to using ccccc you can do either of:
git merge branch_with_cccccc # bring cccccc into dev_on_b
or
git checkout branch_with_ccccc