# RevertIsValid

> Returns true if Provider.Revert is a valid task to perform on at least one of the given assets in the list.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.VersionControl](/engine/6000.0/script-reference/unityeditor/versioncontrol.md)
* **Assembly:** UnityEditor

## RevertIsValid(AssetList, RevertMode)

Returns true if [Provider.Revert](/engine/6000.0/script-reference/unityeditor/versioncontrol/provider/revert.md) is a valid task to perform on at least one of the given assets in the list.

```csharp
public static bool RevertIsValid(AssetList assets, RevertMode mode)
```

### Parameters

**** (\[AssetList]\(/engine/6000.0/script-reference/unityeditor/versioncontrol/assetlist)): List of assets to test.**** (\[RevertMode]\(/engine/6000.0/script-reference/unityeditor/versioncontrol/revertmode)): Revert mode to test for.

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) |             |

### Remarks

```csharp
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.VersionControl;
using UnityEngine;

public class EditorScript : MonoBehaviour
{
    [MenuItem("Version Control/RevertIsValid")]
    public static void ExampleRevertIsValid()
    {
        AssetList assets = new AssetList();
        assets.Add(Provider.GetAssetByPath("Assets/ExampleAsset.cs"));
        Debug.Log(Provider.RevertIsValid(assets, RevertMode.Normal));
    }
}
```

Do note that, [RevertMode.Unchanged](/engine/6000.0/script-reference/unityeditor/versioncontrol/revertmode/unchanged.md) will only test locally checked out and locked files. While the [RevertMode.Normal](/engine/6000.0/script-reference/unityeditor/versioncontrol/revertmode/normal.md) will test locally checked out, locked, added and deleted files.

## RevertIsValid(Asset, RevertMode)

Returns true if [Provider.Revert](/engine/6000.0/script-reference/unityeditor/versioncontrol/provider/revert.md) is a valid task to perform on at least one of the given assets in the list.

```csharp
public static bool RevertIsValid(Asset asset, RevertMode mode)
```

### Parameters

**** (\[Asset]\(/engine/6000.0/script-reference/unityeditor/versioncontrol/asset)): Asset to test.**** (\[RevertMode]\(/engine/6000.0/script-reference/unityeditor/versioncontrol/revertmode)): Revert mode to test for.

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) |             |

### Remarks

```csharp
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.VersionControl;
using UnityEngine;

public class EditorScript : MonoBehaviour
{
    [MenuItem("Version Control/RevertIsValid")]
    public static void ExampleRevertIsValid()
    {
        AssetList assets = new AssetList();
        assets.Add(Provider.GetAssetByPath("Assets/ExampleAsset.cs"));
        Debug.Log(Provider.RevertIsValid(assets, RevertMode.Normal));
    }
}
```

Do note that, [RevertMode.Unchanged](/engine/6000.0/script-reference/unityeditor/versioncontrol/revertmode/unchanged.md) will only test locally checked out and locked files. While the [RevertMode.Normal](/engine/6000.0/script-reference/unityeditor/versioncontrol/revertmode/normal.md) will test locally checked out, locked, added and deleted files.
