Reputation: 1081
Could someone please tell me what would be an equivalent of git reset --soft HEAD^
for an initial commit? I'm trying to find a really safe one-liner without any deletions :)
To further clarify: I want all the files I tediously added to be in the index and ready for committing after the command is run.
Upvotes: 8
Views: 5745
Reputation: 14547
As you found, for the initial commit using git reset --soft HEAD^
doesn't work.
What does work is using git update-ref -d HEAD
.
But provided that there is only one branch and one commit, it's can be easier to just delete the .git
directory and start over. Of course, you should only do that if you know what you are doing.
Upvotes: 11