0
So I'm a comp sci student and just started using version control. Managed to commit my final project but mixed up 'push' with 'force push'. Overwrote everything with an old, broken version. Can't undo it. Project's due in an hour, and all I've got is a bunch of error messages. Guess who's pulling an all-nighter redoing weeks of work...
Submitted 8 months, 2 weeks ago by noobcoder93
0
0
For next time: 'git push' is your default command. 'git push --force' is like a consent to overwrite. Always double-check which branch you're on. Also, if you have Git Extensions or any GUI for git, it might come with some recovery options. Good luck, mate.
0
0
0
0
0
Pro tip for the future: set up a separate branch for major changes so you don't risk the main project. Also consider using 'git reflog', it's a lifesaver. It records every head change and you might be able to get your commits back with it.