Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Moves all your changes to your newly created branch, after wrongfully making changes to master #2513
Comments
|
I think this is more of a new Get Experience feature request. Do you know if there's an easy way to move your changes to a different branch using the new UI? This is certainly a frustration I've had when using Git in the past! |
|
Hi Khabubu, I'm just trying to understand your scenario a little bit better. You situation looks like this, right?
I think you can accomplish this pretty simply by just "git checkout -b " from master. If you want to reset master to before the accidental commit, then you can run "git reset --hard ". You can also do all of this using Team Explorer or the Git tool window in Visual Studio. Before I go into those instructions, though, do you feel like I'm understanding your scenario? Thanks! |
|
Hi Dan You have partially understood my scenario. In my scenarioI have not yet commited to master branch but I have changed a file while on the master branch and I don't want to lose the changes. Now your alternative is valid if I had commited to the master brunch hence the you have suggested to use "git checkout -b", however I want to use the new UI to switch between the local master branch to another local branch withou losing those changes. Hence I provided the current alternative I use which is using the command line and execute the following command "git switch dev". |
|
The situation I would often get into was this:
I wish there was a streamlined way to do 4 Reading up on the Maybe this is simply a case of the new Git experience using the new In summary, I think it's a great idea to consider using
|

Is your feature request related to a problem? Please describe.
I'm always frustrated when I make changes to master branch and what to switch those changes to a new branch or an existing branch.
Describe the solution you'd like
I would like to be able to switch to a new or existing branch and move those changes to that brunch
through a user interface where I can switch to branch with changes.
Describe alternatives you've considered
The current alternative is to open the command prompt and enter the following command
Or if the branch already exists
The text was updated successfully, but these errors were encountered: