# RegisterImporterUndo(string, string)

> Copies the state of the importer for the given asset path.

## Definition

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

```csharp
public static void RegisterImporterUndo(string path, string name)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Path of the asset importer to register for Undo.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the undo operation.

### Remarks

This method is used to Undo a [AssetDatabase.SetImporterOverride](/engine/6000.6/script-reference/unityeditor/assetdatabase/setimporteroverride.md) operation.

### Examples

```csharp
using UnityEditor;
using UnityEngine;
using UnityEditor.AssetImporters;
using UnityEditor.Experimental;

[ScriptedImporter(1, null, new[] {"fbx"})]
class MyFBXImporter : ScriptedImporter
{
    public override void OnImportAsset(AssetImportContext ctx)
    {
        var go = new GameObject("root");
        ctx.AddObjectToAsset("root", go);
        ctx.SetMainObject(go);
    }
}

class ChangeImporterOverrideWithUndo
{
    [MenuItem("Assets/Change Importer To MyFBXImporter With Undo")]
    static void ChangeImporterWithUndo()
    {
        var assetPath = AssetDatabase.GetAssetPath(Selection.activeObject);
        Undo.RegisterImporterUndo(assetPath, "Changed Importer");
        AssetDatabase.SetImporterOverride<MyFBXImporter>(assetPath);
    }
}
```
