How to determine which yml file a replicaset was created from

Hello,
In ReplicaSets practice test of CKA course, there was a task to modify the new-replica-set to use correct busybox image. I tried to find the yml file for this replica-set but was not able to. I used the kubectl describe command, but the output also does not indicate the definition file that the replica set was created from.

The solution uses the kubectl edit command. However, I would like to understand that how can we identify the definition file from which an object (pod, ReplicaSet, or Deployment) is created from?

To get YAML for an existing resource of any kind, you use kubectl get to fetch it for you. In this case, you do

kubectl get rs new-replica-set -o yaml > saved-file.yaml