A German aid worker kidnapped in Pakistan over two years ago has been released in neighbouring Afghanistan, Berlin said on Friday.