That could probably be called a Heisenbug[0]: A bug that disappears or alters its behavior when one attempts to probe or isolate it.
Though it depends on the cause - as others in this comment chain said, if it's just that the file isn't actually being updated between tests, but adding a new line forces an update/recompile/etc., I'm not sure what you'd call it.
Another common cause is that the code you were looking at wasn't actually the code you were running. Between "I added this line and then I removed this same line, and now it works", the executable might have been recompiled.
* My code doesn't work and I can't find the bug even after over an hour
* I add a few lines of <whatever code>. Now it works!
* Now, just for comparison, I remove all the code I just added (or, at least I think I reverted back to previous state). But now it still works.
???