Set Rigidbody variable to Prefab using code

I’m looking to set a Rigidbody variable, using code instead of the Inspector, to a Prefab which already exists in the Unity Project. I tried using GetComponent() but the Prefab is not returned. Is there a way to do this, or am I forced to create the Prefeb in code first?

You have to load the prefab asset to be able to assign it’s reference to a variable.
Use AssetDatabase.LoadAssetAtPath to load your prefab from your asset-folder and then you need to get the reference to the object on which you want to set the variable.

Note that this is all stuff form the UnityEditor namespace and you can only use the assetdatabase in the editor. Even prefabs are an editor-only feature (at least until now).