If you are using a "professional" IDE chances are good that you can restore files from a local History.
In Rubymine for example you can right click files and watch a history of changes independent from the git changes, saved me a few times now ^^
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…