git list previous branch
In git
, how do I go back to the previous branch I was just on? I've got a memory of a fish and easily forget which branch I was on previously- how do I switch back? Also, is it true fish have short memories and what if they're drunk?
An aswer to finding the name of the previous branch you were on is:
git name-rev @{-1} --name-only
Will show you the last branch you were on in terminal.
Source: https://stackoverflow.com/a/59766367
See also Scott Stafford's longer post wish alias setup examples: