Ad

I Made Changes While On The Wrong Branch. I Haven't Committed Yet. How Do Commit My Changes To The Intended Branch?

- 1 answer

  • I'm on branch A and made changes.
  • The changes have not yet been added or committed.
  • These changes are intended for branch B.

How do I go about adding and committing these changes to branch B?

Ad

Answer

It all depends if you already committed the changes. Since you didn't commit the changes yet a git checkout should do the trick.

Ad
source: stackoverflow.com
Ad