I like git, I hope you like it too. I like using the git flow branching model while developing new features or fixing undesired bugs in a stable version.
Sometimes while you’re starting a new feature, you forget changing your current branch and commit a change to the wrong branch (often develop).
Sometimes while you’re starting a new feature, you forget changing your current branch and end up committing a change to the wrong branch (often develop).
Let’s walk through the steps required to move your latest commit from the wrong branch to the right one:
1.- Prerequisites
Create the repository with an initial content and create the develop branch.
Create your feature branch
Commit a change to develop (instead of your feature branch)
WRONG! You commit to develop instead of feature/hello
2.- Fix the wrong commit
Merge develop to your feature branch
Now you already have the change in your feature branch. Now it’s time to remove it from develop branch.