You can use Perl:
use warnings;
use strict;
my $p;
while (<>) {
if (/^\[/) {
chomp $p;
print "$p $_";
undef $p;
} else {
print $p if defined $p;
$p = $_;
}
}
Or from the command line:
perl -lane ' if (/\[/) { print "$p $_"; undef $p} else { print $p if defined $p; $p = $_; }' input