Skip to content

Instantly share code, notes, and snippets.

@UgRoss
Last active March 29, 2020 00:30
Show Gist options
  • Save UgRoss/3b24ee73a25bc6420d26c9ef80de8b27 to your computer and use it in GitHub Desktop.
Save UgRoss/3b24ee73a25bc6420d26c9ef80de8b27 to your computer and use it in GitHub Desktop.
Git checkout to previous branch
@UgRoss
Copy link
Author

UgRoss commented Mar 29, 2020

or shorter equivalent to @{-1}:

git checkout -

You can use the @{-N} syntax to refer to the N-th last branch/commit checked out using "git checkout" operation. You may also specify - which is synonymous to @{-1}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment