-
Notifications
You must be signed in to change notification settings - Fork 160
Troubleshooting Git
Here's where I'll go over some stuff you might run into while working with Git
If you're making frequent commits, this is no big deal! Just run:
git checkout path/to/file
and it'll be good as new.
If you're making frequent commits, this is no big deal! Just run:
git reset --hard
and your repo will be good as new. Just remember: any un-committed files will be lost.
If you're making frequent commits, this is no big deal! Just use:
git stash path/to/file
on all files you want to keep, then run:
git reset --hard
After this, run this command until all your stashed files are back:
git stash pop
If you're making frequent commits, this is no big deal! (Seeing a pattern here? This is just as important as saving a document, or your level's 3D model!) Just run:
git reset --hard HEAD~NUM
where NUM
is the number of commits you want to revert.
If you want to record in the commit history that you've reverted a change, use
git revert HEAD~NUM
That's all I have for now! I'll update this post with both new troubleshooting queries and asciinema videos to show the effects of them!