You may reclaim all or some of the taxes depending on several things, for example how long you stayed in Germany and whether you worked in Italy for the rest of the year.
Did you have other income from your home country?
If you had income in your home country, that affects your tax bracket. Thus you must declare all your worldwide income in the Germany tax return.
If you were unemployed for half of the year, but your tax bracket was calculated based on 12 months salary, you should file the tax return to reclaim some of the taxes.
Should you pay taxes to Germany on your worldwide income?
From which income you pay taxes in Germany, depends on whether you lived in Germany for only 6 months, or stayed longer.
If you lived in Germany for more than 6 consecutive months, you are considered "ordinarily resident" in Germany, meaning that the tax is calculated from your worldwide income (the total you earned in Germany and your home country).
If you lived in Germany for only 6 months (or less), you are not considered tax resident. You pay tax only on income earned in Germany. In this case you will be considered tax resident in your home country.
Source:
https://europa.eu/youreurope/citizens/work/taxes/income-taxes-abroad/index_en.htm
https://europa.eu/youreurope/citizens/work/taxes/income-taxes-abroad/germany/index_en.htm
Have you paid taxes twice?
Another thing is that you may end up paying taxes on the same income to both Germany and your home country. In this case the double taxation treaty between your home country and Germany defines which country has the right for taxation, and one of the countries should return the collected taxes.
Source:
https://www.settle-in-berlin.com/income-tax-germany/how-to-do-avoid-double-taxation-germany/
For example, if your home country has the right for taxation, but you were taxed from the same income in Germany as well, you would reclaim the taxes collected in Germany. You need to provide a proof from the tax officials of your home country that you paid the taxes there. You probably won't get such a certificate already in May, when you normally file the tax return in Germany, but in practice the German tax return can be filed until the end of the year. (This is what I heard from a tax consultant.)
Which country has the right for taxation depends on the treaty. While I don't know about the treaty between Germany and Italy, I have learned that the treaty between Germany and Finland says that you pay taxes to the country where you work. As an exception, if you work in Germany but your employer is not a German company, it gets more complicated.
How can you reclaim a tax refund?
The only way to reclaim taxes is by filing a tax return. You can do this by going to Finanzamt, online, or by using a tax consultant ("Steuerberater"). If you choose to do it online, the state provides a free service called Elster that is only available in German. There are other commercial services that are available in English and provide also help for filling each form. In case of more complicated issues, such as double taxation, it may be safer to use a tax advisor. The tax consultants have a fixed price list - one tax return costs 150 € + 19 % VAT in 2018.
Note that while you may see instructions that advise you to fill the form N-AUS to report foreign income, this only applies to foreign income while you're a resident in Germany. If you worked in your home country before or after moving to Germany, you just report the foreign income in the beginning at WA-ESt. SteuerGo asks this at the end in Other Information.