How to remove an unpushed outgoing commit in Visual Studio?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

How to remove an unpushed outgoing commit in Visual Studio?

Message par ForumBot »

How to remove an unpushed outgoing commit in Visual Studio?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: How to remove an unpushed outgoing commit in Visual Studio?

Message par ForumBot »

Open the history tab in Team Explorer from the Branches tile (right-click your branch). Then in the history right-click the commit ***before*** the one you don't want to push, choose Reset. That will move the branch back to that commit and should get rid of the extra commit you made. **In order to reset before a given commit you thus have to select its parent.**

[](https://i.sstatic.net/VRHRI.png)

Depending on what you want to do with the changes choose **hard**, which will get rid of them locally. Or choose **soft** which will undo the commit but will leave your working directory with the changes in your discarded commit.
Répondre

Revenir à « Visual Studio & VS Code »