A classic mistake faced by every git user

Learning from mistakes will teach us a lifelong lesson, similarly here we are discussing a classic mistake that every git user made at least once i.e. committing code in the wrong branch.  If you identify the mistake at the right time this can be easily managed, but it gets more tricky if you start committing code in the wrong branch....