Git: Switching back to the previous branch

Updated . Posted . Visible to the public. Repeats.

Using git checkout - you can switch back to the branch you previously worked on.

(master) $ git checkout foobar
Switched to branch 'foobar'
(foobar) $ git checkout -
Switched to branch 'master'
(master) $

This also works with other commands like git merge:

(master) $ git checkout foobar
Switched to branch 'foobar'
(foobar) $ git merge -
Merged branch 'master'
Last edit
Henning Koch
License
Source code in this card is licensed under the MIT License.
Posted to makandra dev (2014-03-04 13:50)