Move existing, uncommitted work to a new branch in Git
问题 I started some work on a new feature and after coding for a bit, I decided this feature should be on its own 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: Use the following: git checkout -b <new-branch> This will leave your current branch as is, create and checkout a new branch and keep all your changes. You can then make a commit with: git add <files>