Undo or UndoSelected may work if the project has not been closed since the trim or boolean was done.
If those don’t work try Untrim. It can be more complicated if the object was previously split or trimmed. See Is it possible to delete this Booleen Differance cutout from the solid? - #2 by davidcockey
Also it can useful to DupEdge any trimmed edges or DupBorder before Untrim. Then use the duplicated edges to trim the untrimmed object as needed.
Untrim may not work if ShrinkTrimmedSrf was used after the object was modified, or if Split with Shrink=Yes was used.
Not as advertised for some other modeling software.
A very good practice is to frequently save the project with incremented names. You can use IncrementalSave Rhinoceros Help