Executable code (including keyloggers) may be stored inside of data files but cannot be executed from there so if you are simply backing up and restoring data files to a cleanly installed system there can be no problem. If you wanted to be squeaky clean you could run malwarebytes to check the data files on the backup disk before restoring them to your system.