Composer New Code Is Added, All Existing Code Removed

Every time I try to edit a file to make a change, its just changing the file by adding the new code but removing ALL other code rendering the file useless.