Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 295
Touko Avatar asked Feb 07 '12 13:02

Touko


People also ask

How do I revert a file in Visual Studio?

When you want to discard any modified files/folders, right click on them under Solution Explorer. From the context menu, select Source Control | Undo Pending Changes..., as shown in the following screenshot: Make sure to double confirm whether you really want to undo the file/folder.

How do I reload a Visual Studio project?

In Solution Explorer, select the projects you want to load (press Ctrl while clicking to select more than one project), and then right-click on the project and choose Reload Project. Visual Studio will remember which projects are loaded the next time you open the solution locally.

How do you refresh a file with VS code?

Choose Refresh from the Window menu, or click the Refresh button in the toolbar.


1 Answers

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.

like image 90
Bálint Décsi Avatar answered Nov 10 '22 23:11

Bálint Décsi