How to rotate an RigidBody2D object to an angle and get back to the previous position in the smooth way?

I need to implement a boat movement like below. How can I achieve a smooth rotation to a side and come back straight. I am beginner. Please refer the image.

If i remember right, you should use Slerp (there are tutorials about how to use it correctly).

If this isn’t smooth enough, then you need to set the “base rotation” of the object, then set it’s actual roation each frame, multiplying base rotation by Mathf.Sin(Time.time) and dividing it by a float of your choice . (something like that, i used it only once a while ago). Actually you can use any mathematical curve as long as it goes smoothly from 0 to one.