If you're using Windows then you could simply use Powershell. This reverses the contents of test.txt and saves the result to test2.txt:
$f=Get-Content c:\folder\test.txt
[array]::Reverse($f)
$f | out-file c:\folder\test2.txt
Update:
This should do the trick (reads all the lines from test.txt and rearranges them to test2.txt file the way you wanted):
$content = [System.IO.File]::ReadAllLines("C:\Folder\test.txt")
$a = New-Object System.Collections.ArrayList
$i=0
ForEach ($line in $content) {If ($line -ne "") {$a.insert($i++, $line)} else {$a.insert(0, $line); $i=0}}
$a | out-file C:\Folder\test2.txt
Probably not the most elegant way but it did the job with your test case.