My battery died toward the end of Yosemite installation. Now login screen freezes
Access OS X Recovery by holding Cmd ⌘+R from the time you boot your system until you see the Apple logo. Further instructions:

After your computer finishes starting up, you should see a desktop with an OS X menu bar and an OS X Utilities window with the options listed above.
In order to reinstall OS X, you need to be connected to the Internet using Ethernet or Wi-Fi. If you're using a wireless Internet connection, click the Wi-Fi menu in the upper-right corner of the screen to select a nearby Wi-Fi network. Choose your preferred network name and enter a username and password to join the network if needed.