# Display the deleted code of a function

I deleted the code of a function that I wrote. The function is still working fine but the code is no more available. How can I do to display the code of the function I have written ?

「??f」 works lovely well ! it is the best. DownValues[f] as well (but not UpValues, neither oeher **Values)

PrintDefinitions[f] as well, but requires GeneralUtilities...

• Use ?? f or DownValues[f] (or possibly OwnValues[f], Upvalues[f], and/or SubValues[f] etc). The first will be easier to interpret, if you don't know how down-values work. – Michael E2 Oct 19 '16 at 12:12
• The simplest thing to do is perhaps to call Needs["GeneralUtilities"] and then PrintDefinitions[f]. This will create a separate notebook with a nicely formatted code of your function. You can then select the cells with code and right-click, then use Copy As Plain text, and copy to a new input cell, if you want to. – Leonid Shifrin Oct 19 '16 at 12:14
• Another useful function is LanguageExtendedDefinition, which takes either the symbol or the symbol name as an argument, and returns *Values, Messages and Attributes. – Carl Woll Jan 23 '17 at 5:38

The simplest thing to do is perhaps to call Needs["GeneralUtilities"] and then PrintDefinitions[f]. This will create a separate notebook with a nicely formatted code of your function. You can then select the cells with code and right-click, then use Copy As Plain text`, and copy to a new input cell, if you want to. – Leonid Shifrin Oct 19 '16 at 12:14