---
title: git checkout and see
teaser:
tags: git
author: Gabe Berke-Williams
published_on: 2012-07-03
---

If you use git, you're running `git checkout $BRANCH` all the time. Everyone
likes a fast checkout at the grocery store. How about making your git checkouts
fast, too? Since I do it so often, I want it to go as fast as possible, and I
bet you do too.

Are you ... hot blooded?!

<iframe title="Hot Blooded - Foreigner - YouTube" frameborder="0" height="315" src="https://www.youtube.com/embed/5c1m2BAg2Sc" width="420"></iframe>

`git checkout -` (that's `git checkout` followed by a dash) is the bee's knees.
It switches back to the branch you were on previously. If you run it again,
you're toggled back to the first branch. A useful comparison is `cd -`, which as
you may know takes you back to your most recent directory. Here's an example:

    $ git branch
      alternate
    * master
    $ git checkout alternate
    $ git branch
    * alternate
      master
    $ git checkout -
    # Now we're back to master!
    $ git branch
      alternate
    * master

What are your favorite git tips and tricks?
