git checkout -f A -- . code example Example: git checkout -f //the below code can recover your last commited files git checkout -f