The problem arises when one developer has a file-A open and begins to edit it. Another developer has also written into file-A and committed into trunk.
The first developer svn-updates and file-A is now updated in his working directory but he has already started working on file-A based on the last revision. If she saves the file and then commits, it will overwrite all changes made by the other developer.
In this situation, what can be done to prevent it? Any good workflows? Will a DVCS help resolve this type of conflict?
As long as you save the files in your working directory before doing an update to it then you won’t have the problem you are describing.
I would think you should be able to roll back your local directory to the previous version by doing a:
Then saving the file you are editing, then doing a:
which should then either merge in the changes or prompt you that there is a conflict in the local directory.
Once you resolve the conflict (if there is one) you can commit back to the repo.