NOTE: The Nexus 4 does not have a physical sd card. However, the user directory on the phone is located at /storage/sdcard0/ and will, for the purposes of this guide, be referred to as the sdcard.
So, let's get started.
1. First, you're going to need some variant of the Android SDK/Software Development Kit as well as the Nexus 4 drivers installed. I won't show you how to do this, as there are already many guides and tutorials available.
Here's the link to the official Google ADT/Android Developer Tools.
2. Once you've got everything on your computer set up, open up the Settings app and go to About phone. Scroll down and quickly tap the Build number tile seven times. You have now enabled Developer options.
Go back, enter Developer options and enable USB debugging. An authorization pop-up will appear; allow it.
3. Now, open up a command prompt window and change directory to the location of adb on your computer. If you installed the official SDK, this will be under
List of devices attached random numbers and letters device
4. Make a folder on C:\ (or whatever your OS drive is) with NO SPACES in the file name. You can now make the backup.
adb pull /storage/sdcard0/ C:\folderyoumade
When the copy is complete, you should see something like
x files pulled. 0 files skipped.
To backup specific folders on it, simply change the command to that directory on your phone.
adb pull /storage/sdcard0/folderyouwant/ C:\folderyoumade
5. To restore a backup, simply type
adb push C:\folderyoumade /storage/sdcard0/
NOTE: Restored folders DO NOT replace existing folders on your sdcard. They are merged (so pre-existing files in a folder remain, while any new files are copied in).
NOTE: I recommend that you do not use your phone during a backup or restore so as to make sure all files are properly copied.