1. whether you want to backup a database the sintaxis is:
pg_dump -h
Example:
pg_dump -h localhost -U bob accounting -f accounting07042015.sql
2. whether you want to restore a database you may use this sintaxis:
psql -H
Example:
psql -h localhost -U bob -d accounting -f accounting07042015.sql
pay attention whether you get some warning or error messages.
Cheers