Whenever you develop something and make a mistake when committing (or pushing some code) on the wrong branch onto your SCM server, think of the classic tip of adding the branch name into your shell prompt.
This tip can display each time in the shell the checked out branch and can display some additional info (do you have any locally untracked file, are you behind or ahead of the origin).
Here is a version I made at my work, in 2 flavors :
coloredgitps1.txt (rename it to coloredgitps1.bashrc)
whitegitps1 (rename it to whitegitps1.bashrc)
How to integrate that ?
1°) move the git bashrc file to etc
2°) at the begining of your bashrc file, add the following line of unix script :
$(__git_ps1) to the PS1 var
4°) restart your terminal