I accidentally deleted the prefab for objects in my scene. Is it possible to attach those objects to a new instance of the prefab?

I have the objects (bricks) all laid out in my scene, but somehow the prefab for the objects got deleted. I created a new prefab of the brick object, and I was trying to find a way to tell unity that the bricks I already have in my scene are in fact instances of the new prefab. Is this possible?

Never mind, I figured out I can just drag the objects from the hierarchy into the prefab in the project folder, and it will ask you if you want to replace the prefab. It only seems to work for 1 object at a time though.