Resetting a local branch to a previous state

Resetting a local branch can be done in two different ways. The first one could be resetting the branch to the last committed state available in the local repository. During this, you can select whether to keep your changes or not, but the most common way is to undo all the uncommitted changes that happened in the local branch.

To reset a branch, open Team Explorer and navigate to the Branches view. As shown in the following screenshot, right click on the branch that you want to reset. From the context menu, select Reset | Delete Changes (--hard) to undo all the uncommitted local changes:

The other ...

Get Mastering Visual Studio 2017 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.