0 votes
2 views
in Devops and Agile by (29.1k points)
edited by

I started some work on a new feature and after coding for a bit, I decided this feature should be on its branch.

How do I move the existing uncommitted changes to a new branch and reset my current one?

I want to reset my current branch while preserving existing work on the new feature.

1 Answer

0 votes
by (49.6k points)
selected by
 
Best answer

First, go to the new branch using

git checkout -b <new-branch-name> 

This will checkout to a new branch or existing branch from your current there you can add files using 

git add <files>

And commit the files using

git commit -m”your commit message”

Thus we can move existing uncommitted work to a new branch and there you can commit. 

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...