Git: Switching back to the previous branch

Posted About 10 years ago. 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'
Thomas Klemm
Last edit
About 2 months ago
Henning Koch
License
Source code in this card is licensed under the MIT License.
Posted by Thomas Klemm to makandra dev (2014-03-04 13:50)