Today, Germany is counted as a successful country for its economy. How did Germany has survived from that devastation and rebuild is economy?
This is a topic of debate amongst economists and economic historians - but then what isn't? :)
Non-economists frequently attribute the surging economic performance of Western Europe post WWII to the Marshall Plan, but the amounts of money involved were tiny. To quote de Long and Eichengreen:
Marshall Plan grants ... amounted to less than three percent of the combined national incomes of the recipient countries between 1948 and 1951. They equaled less than a fifth of gross investment in recipient countries. (page 23)
Grants did increase investment, but the increase in growth was something like two percent of national product by the end of the period - trivial in terms of the recovery. (Note that De Long and Eichengreen's discussion is across Western Europe, Germany received a smaller share of the Marshall Plan funds per head than the other major participating European countries).
De Long and Eichengreen also discuss whether the Marshall Plan funds might have released bottlenecks in infrastructure or accessing foreign exchange and dismiss those as possibilities. They do argue that the Marshall Funds might have helped with the political economy of Western Europe, in driving its turn towards pro-market reforms, and contrast this to Argentina. They speculate that this might have been important, but note also the existence of widespread support for the market reforms internally in Europe - their argument is that the Marshall Plan might well have tipped the balance.
This raises an important, general, issue, the Nazi regime only ruled for 12 years, from 1933 to 1945. A German who was 40 in 1933 would be only 52 in 1945, so there was plenty of institutional memory left of what Germany's economies and politics were like pre-fascism. The German economy had been industrialising and growing for decades before the Nazis, so to some extent this was a return to past institutions, rather than new radical reforms. To pick some important examples:
The Christian Democratic Union (CDU) was formed in June 1945, a month after the Nazi surrender in May. The CDU was a diverse group of Germans, including politicians from the Weimar era. The CDU went on to win the 1949 elections, and has remained politically dominant in Germany to this day.
The first German chancellor of West Germany (of the CDU of course) was Konrad Adenauer, who had been active in German politics in the Weimar era, as Mayor of Cologne, and president of the Prussian State Council.
The first Minister for Economic Affairs (and the second Chancellor) was Ludwig Erhard, an economist by training (he received his PhD in 1925) and part of the Soziale Marktwirtschaft, or “social free market" movement. He had been planning for the post war economy since the war started and wrote "War Finances and Debt Consolidation" in 1944, which laid out his vision of the post war economy, with free markets and social redistribution.
Ludwig Erhardt might have been a key figure for Germany's post-war economic success. Even before the 1949 elections Erhard started pro-market reforms in his office (from 1947) as director of the bizonal Office of Economic Opportunity, formally advising the American military governor. Erhard persuaded the Economic Council to adopt a directive giving him the power to remove price controls and then went ahead with removing price controls, rationing, etc.
On the other hand, Eichengreen and Albrecht (2008) argue that the influence of Erhard and the extent of pro-market reforms has been overstated, they note continuity in terms of competition policy (with Germany tolerating much more market concentration than the USA) and labour policy (with widespread industry-wide bargaining with labour unions), plus continued subsidies of coal, electricity and railway prices and rents. On the other hand, the relationship between anti-cartel policy and pro-market policies is unclear: anti-cartel/anti-trust policies have been argued to be often used by large companies to suppress competition. And the existence of price controls in some areas does not mean that their lifting in general was unimportant.
Less controversially, West Germany the post-war period also benefited from returning soldiers and refugees from the provinces that were shifted to Poland and Russia as part of the settlement at the end of the war, and refugees from Eastern Europe. West Germany also was operating in a relatively peaceful broader environment, at least in Western Europe and with the USA, open to trade, and much more economically stable than that of the 1920s and 1930s. On a technological level, various inventions were still playing out in the 1950s and 1960s: the spread of the internal combustion engine with its impacts on agriculture and transport, the continuation of the 1930s building of the autobahn network (incidentally, one of my professors once raised the question of whether the golden growth of the 1950s/60s in the USA was down to building the inter-state highway network), the spread of electronics, of penicillin, improvements in telecommunications technologies, etc.
In summary: German economic recovery was to some extent due to a return to pre-Nazi economic institutions, to some extent due to price and currency reforms championed by Ludwig Erhard, and to some extend due to a favourable broader environment in terms of labour supply, trade relationships and technological developments.
Sources
Bradford de Long, Barry Eichengreen, 1991, The Marshall Plan: History's Most Successful Structural Adjustment Program, http://digitalassets.lib.berkeley.edu/main/b22253613_C044473570.pdf
William J. Baumol and Janusz A. Ordover, Use of Antitrust to Subvert Competition, The Journal of Law & Economics Vol. 28, No. 2, Antitrust and Economic Efficiency: A Conference Sponsored by the Hoover Institution (May, 1985), pp. 247-265, https://www.jstor.org/stable/725521?seq=1
Eichengreen, Barry, Ritschl, Albrecht, (2008) Understanding West German Economic Growth in the 1950s, LSE working paper No. 113/08, http://www.lse.ac.uk/Economic-History/Assets/Documents/WorkingPapers/Economic-History/2008/WP113.pdf