Sometimes, but only if the backup was made before the hack happened. If you restore without fixing how the hacker got in, such as an outdated plugin or weak password, your site can be hacked again quickly.