backtracking
Backtracking is basically a form of searching. In the context of Prolog, suppose that the Prolog interpreter is trying to satisfy a sequence of goals goal_1, goal_2. When the Prolog interpreter finds a set of variable bindings which allow goal_1 to be satisfied, it commits itself to those bindings, and then seeks to satisfy goal_2. Eventually one of two things happens: (a) goal_2 is satisfied and finished with; or (b) goal_2 cannot be satisfied. In either case, Prolog backtracks. That is, it "un-commits" itself to the variable bindings it made in satisfying goal_1 and goes looking for a different set of variable bindings that allow goal_1 to be satisfied. If it finds a second set of such bindings, it commits to them, and proceeds to try to satisfy goal_2 again, with the new bindings. In case (a), the Prolog interpreter is looking for extra solutions, while in case (b) it is still looking for the first solution. So backtracking may serve to find extra solutions to a problem, or to continue the search for a first solution, when a first set of assumptions (i.e. variable bindings) turns out not to lead to a solution.

Example: here is the definition of the built-in Prolog predicate member:

member(X, [X | Rest]). % X is a member if its the first element
member(X, [Y | Rest]) :-
    member(X, Rest).   % otherwise, check if X is in the Rest
You may not think of member as a backtracking predicate, but backtracking is built into Prolog, so in suitable circumstances, member will backtrack:
?- member(X, [a, b, c]).
X = a ;
X = b ;
X = c ;
false.
Here member backtracks to find every possible solution to the query given to it. Consider also:
?- member(X, [a, a, a]).
X = a ;
X = a ;
X = a ;
false.
Here member backtracks even though it keeps on finding the same answer. What about
?- member(a, [a, a, a]).
true ;
true ;
true ;
false.
This is because prolog has three ways of proving that a is a member of [a, a, a].

The term backtracking also applies to seeking several sets of variable bindings to satisfy a single goal.

In some circumstances, it may be desirable to inhibit backtracking, as when only a single solution is required. The Prolog cut goal allows this.

Tracing the execution of a piece of Prolog code that backtracks can be a good way to figure out what happens during backtracking. If you wanted to experiment with backtracking by tracing member, you could achieve this by copying the code for member, given above, changing the name from member to say mem in the three places where it appears, and then tracing your mem procedure.