undo changes file git code example Example 1: git remove my local changes and pull from master git reset --hard Example 2: how to undo git clean -fd command git clean -fdxn