Have you encountered some situation where you did git commit on the wrong branch and now thinking to revert it back and commit in the new branch. Stop worrying about that. Follow these steps and you can overcome the issue
- in the current branch where you have done commit use “git reset HEAD~1”
- then create a new branch “git checkout –b <new branch name>”
- then use “git add .”
- use “git commit –m <message>”
- now do your job, I am not going to write the entire code for you.
Hope this helps.