0

How do I restore my unity project to its last github commit? I was working on my project and I "damaged" it, luckily I used github throughout the process and I would like to return to the stage it was at it's last commit.

I tried cloning it into a different folder but I actually need my original project to be restored to that specific last commit stage

derHugo
  • 83,094
  • 9
  • 75
  • 115
  • 1
    Does this answer your question? [How do I revert a Git repository to a previous commit?](https://stackoverflow.com/questions/4114095/how-do-i-revert-a-git-repository-to-a-previous-commit) – jraufeisen May 26 '23 at 22:23
  • I really doubt unityscript is involved. – BugFinder May 26 '23 at 23:26
  • There's something unclear here: in what way was your clone not what you wanted? Did it have the right files and contents, just in the wrong place, or did it have the wrong files or contents in some way? Please explain a bit more, to make sure you get the right solution for your problem. – joanis May 28 '23 at 20:19

1 Answers1

0

Write this command in git bash in your project directory:

git reset --hard

This command will return your project to the last commit you pushed

  • This answer might be correct, but you should careful to provide caveats any time you say "use `git reset --hard`" to anyone: if there are any uncommitted changes in there, they will be destroyed. Based on the question, I believe that's what OP wants, but they need to know anything wiped by this operation cannot be unwiped. – joanis May 28 '23 at 20:16