# TryGetRevertMethodForFieldName(SerializedProperty, out Action<SerializedProperty>)

> Extension hook for an optional property revert menu item.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.7/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

## TryGetRevertMethodForFieldName(SerializedProperty, Action\<SerializedProperty>)

```csharp
bool TryGetRevertMethodForFieldName(SerializedProperty property, out Action<SerializedProperty> revertMethod)
```

### Parameters

**** (\[SerializedProperty]\(/engine/6000.7/script-reference/unityeditor/serializedproperty)): The property that the user is interacting with.**** (\[Action\<SerializedProperty>]\(https\://learn.microsoft.com/dotnet/api/system.action)): Assign the custom action to be called if the user selects the revert menu command.

### Returns

| Type                                                          | Description                                                |
| ------------------------------------------------------------- | ---------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True, if the revert menu should be shown for the property. |

### Remarks

Called as the context menu is being built to retrieve the method to be called (if any) when the user select the 'revert' menu item. The boolean return value defines if a revert menu item is to be shown.
