If something is public:
The instant you add that to your scene / prefab it is 10f … AND THEN IT GETS SERIALIZED.
Now go change the value in code. Note that it has no effect: the serialized value writes over the code value.
This is how Unity serialization works.
If you want to define it in code, make the variable private.
If you want to define it in the editor, make it public and DO NOT INITIALIZE IT.
Instead, make a Reset function, which ONLY runs at the instant it is added:
void Reset()
{
movementSpeed = 10.0f;
}
And Reset()
only runs in editor when you drag it on there.