Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Introduction to Git Managing Committed Files Commit SHAs and Undoing Commits

Last practice revert, it ask to commit or stash

While practising it says following "git revert 60adb
error: Your local changes would be overwritten by revert.
hint: Commit your changes or stash them to proceed.
fatal: revert failed "

I do not know what stash means and why should I commit, won't commit, commit that changes which we want to revert?

1 Answer

Jay McGavren
Jay McGavren
Treehouse Teacher

This message means that one or more of the files in your working directory have been modified since the last commit, probably using a text editor. The revert command is meant for undoing changes in a commit, not for discarding changes to modified files.

If you run the git status command, it will include a hint on how to undo the changes to your modified files.

You can also read about git stash here: https://git-scm.com/book/en/v1/Git-Tools-Stashing