No, this will not work in general.
An exception would be, if a echo on all enabled the display of all processed code during the program runs. But without this there is no chance to use the output to the command window to decide, which code has created this output. Example:
% Command window:
2
% Possible codes:
x = [pi, sin(1.234)];
fprintf('%d\n', length(x))
% Or:
x = clock;
fprintf('%d\n', x(5))
And this is a very trivial example only.
But it would be trivial to reconstruct the deleted file in the leven of the operating system. Deleting does not overwrite the biots on the harddisk, but removes the point in the file system table only.