I was trying to change parent of an object and while changing, the object seems really big and position changed, even though its transform values are same. I am really new to blender. How can if fix this.
Because when you parent an objectA to an objectB, objectB will follow objectA's transformations (location, rotation and scale), but it will keep its own transformation references, they won't be affected by the parent, and you will find them back if you unparent it.
If you want to keep the transformation you're currently seeing in the scene for this object, instead of simply deparenting, deparent with AltP > Deparent And Keep Transformation.