I was working on master branch, made some changes and then stashed them. Now, my master is at HEAD.
But now, I want to retrieve these changes but to a new branch which branches from the HEAD version of the master branch.
How do i do this ?
I was working on master branch, made some changes and then stashed them. Now, my master is at HEAD.
But now, I want to retrieve these changes but to a new branch which branches from the HEAD version of the master branch.
How do i do this ?
If you have some changes on your workspace and you want to stash them into a new branch use this command:
git stash branch branchName
It will make:
- a new branch (starting from the commit at which the stash was originally created)
- move changes to this branch
- and remove latest stash (Like: git stash pop)
After running this command, you will want to git add the changes and to commit them.