There is no “my” in open source
medium.com
medium.com
That's not quite true. I think the disconnect comes from a misunderstanding of ownership vs licensing. When you release under most open source licenses, you grant license to anyone to use and to republish your code. It's still owned by you, but can be used, modified, and published by anyone else.
And there's nothing stopping you from releasing it under a different license as well.
So reversing the removal of code is perfectly fine.