title: CocoaPods deintegrate deletes workspace files
body: <p>I'm using Xcode and CocoaPods, and Occasionally when I run <code>pod deintegrate</code>, followed by <code>pod install</code>, unrelated files in my workspace will be deleted. It happened a few times, and I thought it was due to my accidentally placing project files in the Pods directory, which is not under version control, but it recently happened again where this was for sure not the case. I'm quite stumped as to what is causing this, and I haven't been able to find any previous mentions of this problem online, nor have I been able to reproduce it systematically (though to be sure unsystematically, all too many times).</p>
  <p>A guard against this is of course to <code>git status</code> and make sure that everything is <code>git add</code>-ed before ever deintegrating the workspace, which is good practice anyway, but for large commits it can be hard sometimes to remember exactly which files have been added, and at any rate <code>git status</code> will not catch files that for some reason have been dumped into untracked directories.</p>
  <p>I realize this is quite vague, but has anyone else experienced something like this? Or has an idea of ways to address it?</p>
  <p><strong>EDIT:</strong> I think I've figured out the cause. Sometimes when I <code>Cmd + n</code> to make a new file, the interface will not put the new file in the right <em>folder</em> (on the Mac) even though it puts in the right <em>group</em> (in Xcode). Taking care to ensure that both the folder and the group match seems to solve it, along with double-checking that the file has an <code>A</code> on the Xcode interface to make sure it's been added to version control. The reason <code>Cmd + n</code> was behaving differently was that I was invoking it from different places. E.g., if I was invoking it while viewing a file in the Pods group/folder, even if I set the <em>group</em> to something else, it would still save in the Pods <em>folder</em>.</p>