Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undo last commit in TFS

Is there a way to undo/delete the last commit in TFS. I don't want to rollback because as far as I'm aware this creates a new changeset that does the inverse..

Ideally I need the equivalent of a git reset so the changeset is trashed but my changes are preserved locally..

Is this possible in TFS?

like image 361
Tom Miller Avatar asked Dec 19 '22 09:12

Tom Miller


2 Answers

Nope, there is no way to undo a changeset except for rollback which is a new changeset by itself.

A changeset is a permanent part of the history of your version-controlled items and cannot be undone or removed.

MSDN LINK

like image 151
Isaiah4110 Avatar answered Dec 28 '22 10:12

Isaiah4110


Nope, the change cannot be cancel.

However (if it is not a binary file) you could set the file content back.

You could copy text of the previous version from file comparison feature in TFS. To do it, go to commit you want to revert, then open the file you want to revert back.

Then paste it to the same file in local, then push it to your repo.

You could undo change to the local file after committing.

Hope that could help.

like image 45
Ahmad Pujianto Avatar answered Dec 28 '22 09:12

Ahmad Pujianto