Touko
Touko

Reputation: 11789

How to revert file in Visual Studio 2010 (reload the file from disc)

I'm starting to use Visual Studio (2010) after years with Eclipse.

Every now and then I've found Eclipse's "Revert" feature pretty useful, that is, to reload the file from disk, discarding all changes. (Nothing to do with version control reverting.)

How can I do this with Visual Studio? Should be pretty simple but I haven't found it yet.

I know that I can do this with "undo until *-indicator disappears" but that's pretty impractical.

Upvotes: 13

Views: 4938

Answers (3)

MrJoeyJoeJoey
MrJoeyJoeJoey

Reputation: 61

If you are using git with Visual Studio: Solution Explorer > Right Click On File > Git > Undo Changes

Upvotes: 0

balintd
balintd

Reputation: 197

In the current version, you find in the Explorer, in the left sidebar. Then Open Editors, and right click on the file you want to revert.

Upvotes: 1

Stefan Z Camilleri
Stefan Z Camilleri

Reputation: 4076

Unfortunately I do not know of a built-in way to do this in VS other than closing the file and reopening it without saving.

There might be some extension that does this, but I am not aware of it :(

Upvotes: 5

Related Questions