How to revert initial git commit? -



How to revert initial git commit? -

i commit git repository @ first time, regret commit , want revert it. try

# git reset --hard head~1

i message:

fatal: ambiguous argument 'head~1': unknown revision or path not in working tree.

this commit first commit of repository, thought how undo git initial commit?

you need delete branch on. can't utilize git branch -d has safety check against doing this. can utilize update-ref this.

git update-ref -d head

do not utilize rm -rf .git or this wipe entire repository including other branches branch trying reset.

git

Comments

Popular posts from this blog

c# - Move local mssql database to webhosted MYSQL -

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -