Unless you used Time Machine to backup your computer when it was still running OS X Yosemite, I am afraid your only option is to erase the hard drive and reinstall OS X Yosemite. You should always make a full backup before upgrading OS X so you are prepared for situations like this, because it happens far more than people like to appreciate.
I am not sure if this is possible but you may be able to use Time Machine on macOS Sierra to perform a full backup to an external USB drive, and then use Migration Assistant on OS X Yosemite to restore your files and apps later on. However I do not know if this will work properly or at all, because this involves using a backup taken from a newer operating system release and restoring it on an older version. It seems theoretically possible, but Migration Assistant might well prevent backups designed for newer operating system releases from being used. Alternatively, the safest option might be to simply backup your files and data onto an external USB drive (e.g. a pen drive) without using Time Machine and then restore your computer to OS X Yosemite.
If OS X Yosemite is the version that came with your Mac, you can use Internet Recovery to restore OS X. It remains on your Mac even if you wipe your drive using Disk Utility or upgrade the operating system, and replaces the need for operating system restore discs to be included with new Macs. To boot into Internet Recovery, power down your Mac and hold down the Command (⌘), Alt (⌥) and R keys together as you turn your Mac back on. Keep these keys held down until you see a spinning globe on screen with "Starting Internet Recovery."
Once you are within Internet Recovery, you will need to erase your hard drive before reinstalling OS X. You can do this with Disk Utility, located in the Utilities menu. Simply select your hard drive from the left side and select the Erase button at the top of the application window. All data will be lost, so make sure you have already made backups at this point as the process is irreversible. Once you've erased your hard drive, close Disk Utility and follow the steps on screen to reinstall OS X.
Hope this helps.