I intended to keep the file but deleted it accidentally. I deleted it … mistake.
Explication
By mistake is the fixed expression for an unintended action, matching the accidental deletion. With mistake may seem to describe an error, but it is not the standard manner phrase.