How to recover overwritten file in linux

accidently I overwritten my file in one of my virtual machine which is Rhel based os .How to recover my old content .can someone help me on this

Intially my file1 has content1 and my file2 has content2 bymistake i have copied x1.yml content to x2.yml file

[root@vm-25 pv]# cp x1.yml x2.yml
cp: overwrite 'x2.yml'? y```

Read more here:

Content Attribution

This content was originally published by Hari at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: