To "Apply" to the project by using a script?

It can be reflected in Project if the Apply button of Prefab in Inspector is pushed.

What should I do for carrying out the same function as Apply with a script?

How to return is found in the following way by the way. But I do not know how to apply.


Any help would be appreciated, Thanks!

Since the answer was found, it indicates.


PrefabUtility.ReplacePrefab(obj, PrefabUtility.GetPrefabParent(obj), ReplacePrefabOptions.ConnectToPrefab);