Make backup before overwriting file with cp

First, try to copy a file:

cp /etc/hosts ~
If we try again the above command, the file will be overwitten. We can keep a backup of existing file before it will be overwritten - by using --backup option:
cp --backup=numbered /etc/hosts ~
If you issue above command again - a new backup with will be created with different number.

Verify - you'll see the backed up files too:
cd
ls -l hosts*