FrankTheTank
FrankTheTank

Reputation:

How do I overwrite my local changes in TortoiseSVN?

Lets say I did a check out, edited some stuff and realized I want to re-download the repository code and overwrite my local changes without commiting them.

I downloaded a project, made some edits and I realize I don't like my local changes (which I haven't comitted yet). How can I get back to the current state of the repository without deleting the folder?

How do I do this?

Upvotes: 23

Views: 24207

Answers (6)

Walden Leverich
Walden Leverich

Reputation: 4546

You can either revert the changes (right-click, it's an option) or you can delete the file(s) in question and update. The difference is, revert will revert to the last version you checked out, while delete and update will "revert" to the latest version in the repository, depends on what you're trying to accomplish. Oh, and revert can be done w/out access to the repository, where delete and update can't.

Andy adds a good point that a diff is in order to make sure you're discarding what you think you're discarding. Many times I've forgotten about changes I've made and blew away more than I thought I was.

Upvotes: 12

Andy Dent
Andy Dent

Reputation: 17971

From the Explorer context menu, TortoiseSVN, Revert (you may have moved some common commands up from the Tortoise sub-menu to the main context menu).

However, before reverting, I would do a diff (context menu, TortoiseSVN, Diff with previous version) to be certain that you are only throwing away what you think you're throwing away.

It is very easy to only think of the most recent changes and forget that you haven't committed something you want to keep.

Upvotes: 6

eglasius
eglasius

Reputation: 36035

right click-tortoise svn-revert

Upvotes: 44

Dave
Dave

Reputation: 4468

If you just update then Subversion will merge the changes made in the repository into your local copy. An update won't cause your changes to be sent to the repository.

To remove your changes from your working copy, select the files/directories you want to revert and choose Revert from the TortoiseSVN menu.

Upvotes: 2

Jonathan Adelson
Jonathan Adelson

Reputation: 3321

revert.

It should appear in the menu when you right click on the file you changed. That should lose your changes.

Upvotes: 2

i_am_jorf
i_am_jorf

Reputation: 54610

Just delete the folders (not svn delete, but file-system delete) that contain those files, then sync from a common root to replace them.

Upvotes: 0

Related Questions