Restore deleted or lost files with git

Published: 06 February 2024
on channel: Dev Leonardo
1,859
22

❌ Remember that file you deleted last week? Too bad, now you need it.
Let's see how git restore can help you recover it.

There are a few ways to restore deleted files in git, depending on how far away in the history the file was deleted. I’ll cover the most common scenarios and how can you find lost files with git, with the help of `git log` for those cases where you don't exactly remember when it happened.

You might also want to know how to undo a commit:    • Undo a Commit on Git  

_______________________________
Hit like and subscribe for more content! :D

Beginner-Friendly Open Source Projects: https://github.com/DevLeonardoCommunity
Join the Discord community! Here's the invite:   / discord  

You can also follow me on the other platforms:
Twitter:   / balastrong  
dev.to: https://dev.to/balastrong
Home: https://leonardomontini.dev/
TikTok:   / balastrong  
GitHub: https://github.com/Balastrong
Instagram:   / devbalastrong  
_______________________________
TIMESTAMPS
00:00 Simple case
01:07 Restore from main
01:57 Find the deleted file
02:54 Recover from a commit
04:15 Undo a commit

Sound effects from https://www.zapsplat.com

#git


On this page of the site you can watch the video online Restore deleted or lost files with git with a duration of hours minute second in good quality, which was uploaded by the user Dev Leonardo 06 February 2024, share the link with friends and acquaintances, this video has already been watched 1,859 times on youtube and it was liked by 22 viewers. Enjoy your viewing!