There are two punishments that are attached to sins: eternal(only attached to mortal sins) and temporal( attached to mortal and venial sins). When you go to confession and are absolved of your sins the eternal punishment (hell) is removed, however, the temporal punishment remains. In order to remove the temporal punishment we have indulgences. Anyone who dies without eternal punishment but with remaining temporal punishment will go to purgatory, and ultimately heaven. So to answer your question, yes confession restores you to grace making heaven a possibility again.