how to remove initialize existing git repository code example Example 1: how to undo init git rm -rf .git Example 2: delete git repository command line rm -rf .git