问题 I really like git checkout - to move to my previous branch. But sometimes I only need to know what my previous branch name is. How could I ask Git that? For example, if git checkout - moves to branch "prev", I want the command to get just "prev". 回答1: git checkout - is shorthand for git checkout @{-1} (see here): 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} . You can pass