If you have “replaced” the file by saving over it, you've done exactly what asked the system to do. Depending upon whether the disk sectors were actually overwritten or different disk sectors were used for the new copy, you might be able to use one or another third party “deleted file recovery” utility programs to recover the old file.
Alternatively, if you were using some type of continuous backup facility, you might be able to find the older copy of the file there.
Generally speaking, when doing edits to a file, it is best practice to make a copy of the file that you wish to edit in case of either some program failure or an “oopsie” moment where you overwrite content inappropriately. When making extensive changes to a file, it is likewise best practice to regularly save current work and make a new copy “just in case.” When you are finally done with your content creation / edits, then carefully delete all those backup copies.
- Dov