Did you commit in the wrong branch?

Hey fellas,

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

  1. in the current branch where you have done commit use “git reset HEAD~1”
  2. then create a new branch “git checkout –b <new branch name>”
  3. then use “git add .”
  4. use “git commit –m <message>”
  5. now do your job, I am not going to write the entire code for you.

Hope this helps.

Leave a Reply

Your email address will not be published. Required fields are marked *

How to whitelist website on AdBlocker?

How to whitelist website on AdBlocker?

  1. 1 Click on the AdBlock Plus icon on the top right corner of your browser
  2. 2 Click on "Enabled on this site" from the AdBlock Plus option
  3. 3 Refresh the page and start browsing the site
%d bloggers like this: