Hi Shreyas,
We are having some trouble reproducing the behavior you are seeing...do you think you could post steps describing what you are doing and what you are seeing (keypresses, how you are opening the file, how you are saving the file, etc.) ? Feel free to post screenshots if you want, too.
To test this I opened a CPP file which is local and in my workspace by double clicking on the file in the Project Explorer. I then entered a new line and typed some characters and hit save (Ctrl + S). I then used undo (Ctrl + Z) to undo all the changes I made since opening the file, and the modifications were undone.
- Ryan